1 <!-- WSUG Chapter Capture -->
4 <chapter id="ChapterCapture">
5 <title>Capturing Live Network Data</title>
6 <section id="ChCapIntroduction">
7 <title>Introduction</title>
9 Capturing live network data is one of the major features of Wireshark.
12 The Wireshark capture engine provides the following features:
17 Capture from different kinds of network hardware (Ethernet, Token Ring,
21 Stop the capture on different triggers like: amount of captured data,
22 captured time, captured number of packets.
25 Simultaneously show decoded packets while Wireshark keeps on capturing.
28 Filter packets, reducing the amount of data to be captured, see <xref
29 linkend="ChCapCaptureFilterSection"/>.
32 Capturing into multiple files while doing a long term capture, and in
33 addition the option to form a ringbuffer of these files, keeping only
34 the last x files, useful for a "very long term" capture, see <xref
35 linkend="ChCapCaptureFiles"/>.
38 Simultaneous capturing from multiple network interfaces.
41 The capture engine still lacks the following features:
44 Stop capturing (or doing some other action), depending on the captured
51 <section id="ChCapPrerequisitesSection"><title>Prerequisites</title>
53 Setting up Wireshark to capture packets for the first time can be tricky.
55 <tip><title>Tip!</title><para>
56 A comprehensive guide "How To setup a Capture" is available at:
57 <ulink url="&WiresharkWikiPage;/CaptureSetup">&WiresharkWikiPage;/CaptureSetup</ulink>.
60 Here are some common pitfalls:
64 You need to have root / Administrator privileges to start a live
70 You need to choose the right network interface to capture packet data
76 You need to capture at the right place in the network to see the
77 traffic you want to see.
88 If you have any problems setting up your capture environment, you should
89 have a look at the guide mentioned above.
93 <section id="ChCapCapturingSection"><title>Start Capturing</title>
95 One of the following methods can be used to start capturing packets with
100 You can get an overview of the available local interfaces using the
101 "<inlinegraphic entityref="WiresharkToolbarCaptureInterfaces" format="PNG"/>
102 Capture Interfaces" dialog box, see
103 <xref linkend="ChCapCaptureInterfacesDialogWin32"/> or
104 <xref linkend="ChCapCaptureInterfacesDialog"/>. You can start a
105 capture from this dialog box, using (one of) the "Capture" button(s).
110 You can start capturing using the
111 "<inlinegraphic entityref="WiresharkToolbarCaptureOptions" format="PNG"/>
112 Capture Options" dialog box, see
113 <xref linkend="ChCapCaptureOptionsDialog"/>.
118 If you have selected the right capture options before, you can
119 immediately start a capture using the
120 "<inlinegraphic entityref="WiresharkToolbarCaptureStart" format="PNG"/>
121 Capture Start" menu / toolbar item. The capture
122 process will start immediately.
127 If you already know the name of the capture interface, you can start
128 Wireshark from the command line and use the following:
132 This will start Wireshark capturing on interface eth0, more details
133 can be found at: <xref linkend="ChCustCommandLine"/>.
140 <section id="ChCapInterfaceSection">
141 <title>The "Capture Interfaces" dialog box</title>
143 When you select "Interfaces..." from the Capture menu, Wireshark pops
144 up the "Capture Interfaces" dialog box as shown in
145 <xref linkend="ChCapCaptureInterfacesDialogWin32"/> or
146 <xref linkend="ChCapCaptureInterfacesDialog"/>.
147 <warning><title>This dialog consumes lots of system resources!</title>
149 As the "Capture Interfaces" dialog is showing live captured data, it is
150 consuming a lot of system resources. Close this dialog as soon as
151 possible to prevent excessive system load.
154 <note><title>Not all available interfaces may be displayed!</title>
156 This dialog box will only show the local interfaces Wireshark knows
157 of. It will not show interfaces marked as hidden in <xref linkend="ChCustInterfaceOptionsSection"/>.
158 As Wireshark might not be able to detect all local interfaces, and it
159 cannot detect the remote interfaces available, there could be more capture
160 interfaces available than listed.
165 As it is possible to simultaneously capture packets from multiple interfaces,
166 the toggle buttons can be used to select one or more interfaces.
168 <figure id="ChCapCaptureInterfacesDialogWin32">
169 <title>The "Capture Interfaces" dialog box on Microsoft Windows</title>
170 <graphic entityref="WiresharkCaptureInterfacesDialogWin32" format="PNG"/>
172 <figure id="ChCapCaptureInterfacesDialog">
173 <title>The "Capture Interfaces" dialog box on Unix/Linux</title>
174 <graphic entityref="WiresharkCaptureInterfacesDialog" format="PNG"/>
177 <varlistentry><term><command>Device (Unix/Linux only)</command></term>
180 The interface device name.
184 <varlistentry><term><command>Description</command></term>
187 The interface description provided by the operating system, or the
188 user defined comment added in <xref linkend="ChCustInterfaceOptionsSection"/>.
192 <varlistentry><term><command>IP</command></term>
195 The first IP address Wireshark could find for this interface.
196 You can click on the address to cycle through other addresses
197 assigned to it, if available.
198 If no address could be found "none" will be displayed.
202 <varlistentry><term><command>Packets</command></term>
205 The number of packets captured from this interface, since this
206 dialog was opened. Will be greyed out, if no packet was captured
211 <varlistentry><term><command>Packets/s</command></term>
214 Number of packets captured in the last second. Will be greyed out,
215 if no packet was captured in the last second.
219 <varlistentry><term><command>Stop</command></term>
222 Stop a currently running capture.
226 <varlistentry><term><command>Start</command></term>
229 Start a capture on all selected interfaces immediately, using the settings
230 from the last capture or the default settings, if no options have been
235 <varlistentry><term><command>Options</command></term>
238 Open the Capture Options dialog with the marked interfaces selected, see
239 <xref linkend="ChCapCaptureOptions"/>.
243 <varlistentry><term><command>Details (Microsoft Windows only)</command></term>
246 Open a dialog with detailed information about the interface, see
247 <xref linkend="ChCapInterfaceDetailsSection"/>.
251 <varlistentry><term><command>Help</command></term>
258 <varlistentry><term><command>Close</command></term>
261 Close this dialog box.
268 <section id="ChCapCaptureOptions">
269 <title>The "Capture Options" dialog box</title>
271 When you select Options... from the Capture menu (or use the corresponding
272 item in the "Main" toolbar), Wireshark pops
273 up the "Capture Options" dialog box as shown in
274 <xref linkend="ChCapCaptureOptionsDialog"/>.
276 <figure id="ChCapCaptureOptionsDialog">
277 <title>The "Capture Options" dialog box</title>
278 <graphic entityref="WiresharkCaptureOptionsDialog"/>
280 <tip><title>Tip!</title>
282 If you are unsure which options to choose in this dialog box, just try
283 keeping the defaults as this should work well in many cases.
286 <section><title>Capture frame</title>
288 The table shows the settings for all available interfaces:
292 The name of the interface and its IP addresses. If no address could
293 be resolved from the system, "none" will be shown.
297 <para>loopback interfaces are not available on Windows platforms.</para>
302 The link-layer header type.
307 The information whether promicuous mode is enabled or disabled.
312 The maximum amount of data that will be captured for each packet.
313 The default value is set to the 65535 bytes.
318 The size of the kernel buffer that is reserved to keep the captured packets.
323 The information whether packets will be captured in monitor mode (Unix/Linux only).
328 The chosen capture filter.
333 checkboxes in the first column the interfaces are selected to be
334 captured from. By double-clicking on an interface the "Edit Interface Settings"
335 dialog box as shown in
336 <xref linkend="ChCapEditInterfacesSettingsDialog"/> will be opened.
341 <command>Capture on all interfaces</command>
345 As Wireshark can capture on multiple interfaces, it is possible to choose to capture on all available interfaces.
351 <command>Capture all packets in promiscuous mode</command>
355 This checkbox allows you to specify that Wireshark
356 should put all interfaces in promiscuous mode when capturing.
360 <varlistentry><term><command>Capture Filter</command></term>
363 This field allows you to specify a capture filter for all interfaces
364 that are currently selected. Once a filter has been entered in this field,
365 the newly selected interfaces will inherit the filter.
366 Capture filters are discussed in more details in
367 <xref linkend="ChCapCaptureFilterSection"/>. It defaults to empty, or
371 You can also click on the button labeled "Capture Filter", and Wireshark
372 will bring up the Capture Filters dialog box and allow you to create
373 and/or select a filter. Please see
374 <xref linkend="ChWorkDefineFilterSection"/>
378 <varlistentry><term><command>Compile selected BPFs</command></term>
381 This button allows you to compile the capture filter into BPF code and
382 pop up a window showing you the resulting pseudo code. This can help in
383 understanding the working of the capture filter you created.
384 The "Compile selected BPFs" button leads you to
385 <xref linkend="ChCapCompileSelectedBpfsDialog"/>.
387 <tip><title>Tip!</title>
389 The execution of BPFs can be sped up on Linux by turning on BPF JIT by
390 executing <programlisting>echo 1 >/proc/sys/net/core/bpf_jit_enable</programlisting>
391 if it is not enabled already. To make the change persistent you can use sysfsutils
392 <ulink url="&SysFsUtils;">sysfsutils</ulink>.
399 <command>Manage Interfaces</command>
403 The "Manage Interfaces" button leads you to
404 <xref linkend="ChCapManageInterfacesDialog"/> where pipes can be defined,
405 local interfaces scanned or hidden, or remote interfaces added (Windows only).
411 <section><title>Capture File(s) frame</title>
413 An explanation about capture file usage can be found in <xref
414 linkend="ChCapCaptureFiles"/>.
417 <varlistentry><term><command>File</command></term>
420 This field allows you to specify the file name that will be
421 used for the capture file. This field is left blank by default.
422 If the field is left blank, the capture data will be stored in a
423 temporary file, see <xref linkend="ChCapCaptureFiles"/> for
427 You can also click on the button to the right of this field to
428 browse through the filesystem.
432 <varlistentry><term><command>Use multiple files</command></term>
435 Instead of using a single file, Wireshark will automatically switch
436 to a new one, if a specific trigger condition is reached.
442 <command>Use pcap-ng format</command>
446 This checkbox allows you to specify that Wireshark saves the captured
447 packets in pcap-ng format. This next generation capture file format is
448 currently in development. If more than one interface is chosen for
449 capturing, this checkbox is set by default. See
450 <ulink url="&WiresharkWikiPcapNgPage;"/> for more details on pcap-ng.
454 <varlistentry><term><command>Next file every n megabyte(s)</command></term>
457 Multiple files only: Switch to the next file after the given
458 number of byte(s)/kilobyte(s)/megabyte(s)/gigabyte(s) have been
463 <varlistentry><term><command>Next file every n minute(s)</command></term>
466 Multiple files only: Switch to the next file after the given
467 number of second(s)/minutes(s)/hours(s)/days(s) have elapsed.
471 <varlistentry><term><command>Ring buffer with n files</command></term>
474 Multiple files only: Form a ring buffer of the capture files, with
475 the given number of files.
479 <varlistentry><term><command>Stop capture after n file(s)</command></term>
482 Multiple files only: Stop capturing after switching to the next
483 file the given number of times.
489 <section><title>Stop Capture... frame</title>
491 <varlistentry><term><command>... after n packet(s)</command></term>
494 Stop capturing after the given number of packets have been
499 <varlistentry><term><command>... after n megabytes(s)</command></term>
502 Stop capturing after the given number of
503 byte(s)/kilobyte(s)/megabyte(s)/gigabyte(s) have been captured.
504 This option is greyed out, if "Use multiple files" is selected.
508 <varlistentry><term><command>... after n minute(s)</command></term>
511 Stop capturing after the given number of
512 second(s)/minutes(s)/hours(s)/days(s) have elapsed.
518 <section><title>Display Options frame</title>
522 <command>Update list of packets in real time</command>
526 This option allows you to specify that Wireshark
527 should update the packet list pane in real time. If you
528 do not specify this, Wireshark does not display any
529 packets until you stop the capture. When you check this,
530 Wireshark captures in a separate process
531 and feeds the captures to the display process.
537 <command>Automatic scrolling in live capture</command>
541 This option allows you to specify that Wireshark
542 should scroll the packet list pane as new packets come
543 in, so you are always looking at the last packet. If you
544 do not specify this, Wireshark simply adds new packets onto
545 the end of the list, but does not scroll the packet list
546 pane. This option is greyed out if
547 "Update list of packets in real time" is disabled.
553 <command>Hide capture info dialog</command>
557 If this option is checked, the capture info dialog described in
558 <xref linkend="ChCapRunningSection"/> will be hidden.
564 <section><title>Name Resolution frame</title>
567 <term><command>Enable MAC name resolution</command></term>
570 This option allows you to control whether or not
571 Wireshark translates MAC addresses into names, see
572 <xref linkend="ChAdvNameResolutionSection"/>.
577 <term><command>Enable network name resolution</command></term>
580 This option allows you to control whether or not
581 Wireshark translates network addresses into names, see
582 <xref linkend="ChAdvNameResolutionSection"/>.
587 <term><command>Enable transport name resolution</command></term>
590 This option allows you to control whether or not
591 Wireshark translates transport addresses into protocols, see
592 <xref linkend="ChAdvNameResolutionSection"/>.
598 <section><title>Buttons</title>
600 Once you have set the values you desire and have selected the
601 options you need, simply click on <command>Start</command> to commence the
602 capture, or <command>Cancel</command> to cancel the capture.
605 If you start a capture, Wireshark allows you to stop capturing when
606 you have enough packets captured, for details see
607 <xref linkend="ChCapRunningSection"/>.
612 <section id="ChCapEditInterfaceSettingsSection">
613 <title>The "Edit Interface Settings" dialog box</title>
615 If you double-click on an interface in <xref linkend="ChCapCaptureOptionsDialog"/>
616 the following dialog box pops up.
618 <figure id="ChCapEditInterfacesSettingsDialog">
619 <title>The "Edit Interface Settings" dialog box</title>
620 <graphic entityref="WiresharkCaptureEditInterfacesSettingsDialog" format="PNG"/>
623 You can set the following fields in this dialog box:
626 <varlistentry><term><command>IP address</command></term>
629 The IP address(es) of the selected interface. If no address could
630 be resolved from the system, "none" will be shown.
634 <varlistentry><term><command>Link-layer header type</command></term>
637 Unless you are in the rare situation that you need this, just keep
638 the default. For a detailed description, see
639 <xref linkend="ChCapLinkLayerHeader"/>
643 <varlistentry><term><command>Wireless settings (Windows only)</command></term>
646 Here you can set the settings for wireless capture using the AirPCap adapter.
647 For a detailed description, see the AirPCap Users Guide.
651 <varlistentry><term><command>Remote settings (Windows only)</command></term>
654 Here you can set the settings for remote capture.
655 For a detailed description, see <xref linkend="ChCapInterfaceRemoteSection"/>
661 <command>Capture packets in promiscuous mode</command>
665 This checkbox allows you to specify that Wireshark
666 should put the interface in promiscuous mode when capturing.
667 If you do not specify this, Wireshark will only capture the
668 packets going to or from your computer (not
669 all packets on your LAN segment).
674 If some other process has put the interface in
675 promiscuous mode you may be capturing in promiscuous
676 mode even if you turn off this option.
682 Even in promiscuous mode you still won't necessarily see all packets
683 on your LAN segment, see <ulink url="&WiresharkFAQPromiscPage;"/> for
684 some more explanations.
689 <varlistentry><term><command>Limit each packet to n bytes</command></term>
692 This field allows you to specify the maximum amount of
693 data that will be captured for each packet, and is
694 sometimes referred to as the <command>snaplen</command>. If disabled,
695 the value is set to the maximum 65535, which will be sufficient for most
696 protocols. Some rules of thumb:
701 If you are unsure, just keep the default value.
706 If you don't need all of the data in a packet - for example, if you
707 only need the link-layer, IP, and TCP headers - you might want to
708 choose a small snapshot length, as less CPU time is required for
709 copying packets, less buffer space is required for packets, and thus
710 perhaps fewer packets will be dropped if traffic is very heavy.
715 If you don't capture all of the data in a packet, you might find that
716 the packet data you want is in the part that's dropped, or that
717 reassembly isn't possible as the data required for reassembly is
724 <varlistentry><term><command>Buffer size: n megabyte(s)</command></term>
727 Enter the buffer size to be used while capturing. This is the size
728 of the kernel buffer which will keep the captured packets, until
729 they are written to disk. If you encounter packet drops, try
730 increasing this value.
736 <command>Capture packets in monitor mode (Unix/Linux only)</command>
740 This checkbox allows you to setup the Wireless interface to capture
741 all traffic it can receive, not just the traffic on the BSS to which
742 it is associated, which can happen even when you set promiscuous mode.
743 Also it might be necessary to turn this option on in order to see
744 IEEE 802.11 headers and/or radio information from the captured frames.
749 In monitor mode the adapter might disassociate itself from the network
750 it was associated to.
755 <varlistentry><term><command>Capture Filter</command></term>
758 This field allows you to specify a capture filter.
759 Capture filters are discussed in more details in
760 <xref linkend="ChCapCaptureFilterSection"/>. It defaults to empty, or
764 You can also click on the button labeled "Capture Filter", and Wireshark
765 will bring up the Capture Filters dialog box and allow you to create
766 and/or select a filter. Please see
767 <xref linkend="ChWorkDefineFilterSection"/>
771 <varlistentry><term><command>Compile BPF</command></term>
774 This button allows you to compile the capture filter into BPF code and
775 pop up a window showing you the resulting pseudo code. This can help in
776 understanding the working of the capture filter you created.
783 <section id="ChCapCompileSelectedBpfsSection">
784 <title>The "Compile Results" dialog box</title>
786 This figure shows the compile results of the selected interfaces.
788 <figure id="ChCapCompileSelectedBpfsDialog">
789 <title>The "Compile Results" dialog box</title>
790 <graphic entityref="WiresharkCaptureCompileSelectedBPFsDialog" format="PNG"/>
793 In the left window the interface names are listed. A green bullet indicates a successful
794 compilation, a red bullet a failure. The results of an individual interface are shown
795 in the right window, when it is selected.
799 <section id="ChCapManageInterfacesSection">
800 <title>The "Add New Interfaces" dialog box</title>
802 As a central point to manage interfaces this dialog box consists of three tabs
803 to add or remove interfaces.
805 <figure id="ChCapManageInterfacesDialog">
806 <title>The "Add New Interfaces" dialog box</title>
807 <graphic entityref="WiresharkCaptureManageInterfacesDialog" format="PNG"/>
810 <title>Add or remove pipes</title>
811 <figure id="ChCapManageInterfacesPipesDialog">
812 <title>The "Add New Interfaces - Pipes" dialog box</title>
813 <graphic entityref="WiresharkCaptureManageInterfacesPipesDialog" format="PNG"/>
815 <para>To successfully add a pipe, this pipe must have already been created.
816 Click the "New" button and type the name of the pipe including its path.
817 Alternatively, the "Browse" button can be used to locate the pipe.
818 With the "Save" button the pipe is added to the list of available interfaces.
819 Afterwards, other pipes can be added.
822 To remove a pipe from the list of interfaces it first has to be selected. Then
823 click the "Delete" button.
827 <title>Add or hide local interfaces</title>
828 <figure id="ChCapManageInterfacesLocalDialog">
829 <title>The "Add New Interfaces - Local Interfaces" dialog box</title>
830 <graphic entityref="WiresharkCaptureManageInterfacesLocalDialog" format="PNG"/>
833 The tab "Local Interfaces" contains a list of available local interfaces, including
834 the hidden ones, which are not shown in the other lists.
837 If a new local interface is added, for example, a wireless interface has been
838 activated, it is not automatically added to the list to prevent the constant scanning
839 for a change in the list of available interfaces. To renew the list a rescan can be done.
842 One way to hide an interface is to change the preferences. If the "Hide" checkbox
843 is activated and the "Apply" button clicked, the interface will not be seen in the
844 lists of the "Capture Options" or "Capture Interfaces" dialog box any more. The changes
845 are also saved in the "Preferences" file.
849 <title>Add or hide remote interfaces</title>
850 <figure id="ChCapManageInterfacesRemoteDialog">
851 <title>The "Add New Interfaces - Remote Interfaces" dialog box</title>
852 <graphic entityref="WiresharkCaptureManageInterfacesRemoteDialog" format="PNG"/>
855 In this tab interfaces on remote hosts can be added. One or more of these
856 interfaces can be hidden. In contrast to the local interfaces they are not
857 saved in the "Preferences" file.
860 To remove a host including all its interfaces from the list, it has to be
861 selected. Then click the "Delete" button.
864 For a detailed description, see <xref linkend="ChCapInterfaceRemoteSection"/>
869 <section id="ChCapInterfaceRemoteSection">
870 <title>The "Remote Capture Interfaces" dialog box</title>
872 Besides doing capture on local interfaces Wireshark is capable of
873 reaching out across the network to a so called capture daemon or service
874 processes to receive captured data from.
876 <note><title>Microsoft Windows only</title>
878 This dialog and capability is only available on Microsoft Windows. On
879 Linux/Unix you can achieve the same effect (securely) through an SSH
884 The Remote Packet Capture Protocol service must first be running on the
885 target platform before Wireshark can connect to it. The easiest way is
886 to install WinPcap from <ulink url="&WinPcapDownloadWebsite;"/> on the
887 target. Once installation is completed go to the Services control panel,
888 find the Remote Packet Capture Protocol service and start it.
890 <note><title>Note</title>
892 Make sure you have outside access to port 2002 on the target platform.
893 This is the port where the Remote Packet Capture Protocol service can
894 be reached, by default.
898 To access the Remote Capture Interfaces dialog use the
899 "Add New Interfaces - Remote" dialog, see
900 <xref linkend="ChCapManageInterfacesRemoteDialog"/>, and select "Add".
902 <section><title>Remote Capture Interfaces</title>
903 <figure id="ChCapInterfaceRemoteDialog">
904 <title>The "Remote Capture Interfaces" dialog box</title>
905 <graphic entityref="WiresharkCaptureOptionsRemoteInterfacesDialog" format="PNG"/>
908 You have to set the following parameter in this dialog:
912 <varlistentry><term><command>Host</command></term>
915 Enter the IP address or host name of the target platform where the
916 Remote Packet Capture Protocol service is listening. The drop down list
917 contains the hosts that have previously been successfully contacted.
918 The list can be emptied by choosing "Clear list" from the drop down list.
922 <varlistentry><term><command>Port</command></term>
925 Set the port number where the Remote Packet Capture Protocol service
926 is listening on. Leave open to use the default port (2002).
930 <varlistentry><term><command>Null authentication</command></term>
933 Select this if you don't need authentication to take place for a
934 remote capture to be started. This depends on the target platform.
935 Configuring the target platform like this makes it insecure.
939 <varlistentry><term><command>Password authentication</command></term>
942 This is the normal way of connecting to a target platform. Set the
943 credentials needed to connect to the Remote Packet Capture Protocol
950 <!-- <section><title>Remote Capture</title>
952 When the connection to the Remote Packet Capture Protocol service is
953 successfully established the "Capture Options" dialog looks like this,
954 see <xref linkend="ChCapInterfaceRemoteCapDialog"/>.
956 <figure id="ChCapInterfaceRemoteCapDialog">
957 <title>The "Remote Capture" dialog box</title>
958 <graphic entityref="WiresharkCaptureOptionsRemoteCaptureDialog" format="PNG"/>
961 The Interface dropdown list now shows the IP address or host name of the
962 Remote Packet Capture Protocol service and the other field shows the
963 interfaces on the remote target. After selecting the desired interface
964 just click <command>Start</command> to start the remote capture.
967 <section><title>Remote Capture Settings</title>
969 The remote capture can be further fine tuned to match your situation.
970 The <command>Remote Settings</command> button in
971 <xref linkend="ChCapEditInterfacesSettingsDialog"/> gives you this option.
972 It pops up the dialog shown in
973 <xref linkend="ChCapInterfaceRemoteSettingsDialog"/>.
975 <figure id="ChCapInterfaceRemoteSettingsDialog">
976 <title>The "Remote Capture Settings" dialog box</title>
977 <graphic entityref="WiresharkCaptureOptionsRemoteSettingsDialog" format="PNG"/>
980 You can set the following parameters in this dialog:
983 <varlistentry><term><command>Do not capture own RPCAP traffic</command></term>
986 This option sets a capture filter so that the traffic flowing back
987 from the Remote Packet Capture Protocol service to Wireshark isn't
988 captured as well and also send back. The recursion in this saturates
989 the link with duplicate traffic.
992 You only should switch this off when capturing on an interface other
993 then the interface connecting back to Wireshark.
997 <varlistentry><term><command>Use UDP for data transfer</command></term>
1000 Remote capture control and data flows over a TCP connection. This
1001 option allows you to choose an UDP stream for data transfer.
1005 <varlistentry><term><command>Sampling option None</command></term>
1008 This option instructs the Remote Packet Capture Protocol service to
1009 send back all captured packets which have passed the capture filter.
1010 This is usually not a problem on a remote capture session with
1011 sufficient bandwidth.
1015 <varlistentry><term><command>Sampling option 1 of x packets</command></term>
1018 This option limits the Remote Packet Capture Protocol service to send
1019 only a sub sampling of the captured data, in terms of number of
1020 packets. This allows capture over a narrow band remote capture
1021 session of a higher bandwidth interface.
1025 <varlistentry><term><command>Sampling option 1 every x milliseconds</command></term>
1028 This option limits the Remote Packet Capture Protocol service to send
1029 only a sub sampling of the captured data, in terms of time. This
1030 allows capture over a narrow band capture session of a higher
1031 bandwidth interface.
1039 <section id="ChCapInterfaceDetailsSection">
1040 <title>The "Interface Details" dialog box</title>
1042 When you select Details from the Capture Interface menu, Wireshark pops
1043 up the "Interface Details" dialog box as shown in
1044 <xref linkend="ChCapInterfaceDetailsDialog"/>. This dialog shows various
1045 characteristics and statistics for the selected interface.
1047 <note><title>Microsoft Windows only</title>
1048 <para>This dialog is only available on Microsoft Windows</para>
1050 <figure id="ChCapInterfaceDetailsDialog">
1051 <title>The "Interface Details" dialog box</title>
1052 <graphic entityref="WiresharkCaptureInterfaceDetailsDialog" format="JPG"/>
1056 <section id="ChCapCaptureFiles"><title>Capture files and file modes</title>
1058 While capturing, the underlying libpcap capturing engine will grab the
1059 packets from the network card and keep the packet data in a (relatively)
1060 small kernel buffer. This data is read by Wireshark and saved into
1061 the capture file(s) the user specified.
1065 Different modes of operation are available when saving this packet data to
1066 the capture file(s).
1069 <tip><title>Tip!</title>
1071 Working with large files (several 100 MB's) can be quite slow. If you plan
1072 to do a long term capture or capturing from a high traffic network, think
1073 about using one of the "Multiple files" options. This will spread the
1074 captured packets over several smaller files which can be much more
1075 pleasant to work with.
1078 <note><title>Note!</title>
1080 Using Multiple files may cut context related information.
1081 Wireshark keeps context information of the loaded packet data, so it can
1082 report context related problems (like a stream error) and keeps information
1083 about context related protocols (e.g. where data is exchanged at the
1084 establishing phase and only referred to in later packets).
1085 As it keeps this information only for the loaded file, using one of
1086 the multiple file modes may cut these contexts. If the establishing phase
1087 is saved in one file and the things you would like to see is in another,
1088 you might not see some of the valuable context related information.
1091 <tip><title>Tip!</title>
1093 Information about the folders used for the capture file(s), can be found
1094 in <xref linkend="AppFiles"/>.
1098 <table id="ChCapTabCaptureFiles"><title>Capture file mode selected by capture options</title>
1100 <colspec colnum="1" colwidth="72pt"/>
1101 <colspec colnum="2" colwidth="80pt"/>
1102 <colspec colnum="3" colwidth="80pt"/>
1103 <colspec colnum="4" colwidth="80pt"/>
1106 <entry>"File" option</entry>
1107 <entry>"Use multiple files" option</entry>
1108 <entry>"Ring buffer with n files" option</entry>
1110 <entry>Resulting filename(s) used</entry>
1118 <entry><command>Single temporary file</command></entry>
1119 <entry>wiresharkXXXXXX (where XXXXXX is a unique number)</entry>
1122 <entry>foo.cap</entry>
1125 <entry><command>Single named file</command></entry>
1126 <entry>foo.cap</entry>
1129 <entry>foo.cap</entry>
1132 <entry><command>Multiple files, continuous</command></entry>
1133 <entry>foo_00001_20100205110102.cap, foo_00002_20100205110318.cap, ...</entry>
1136 <entry>foo.cap</entry>
1139 <entry><command>Multiple files, ring buffer</command></entry>
1140 <entry>foo_00001_20100205110102.cap, foo_00002_20100205110318.cap, ...</entry>
1147 <term><command>Single temporary file</command></term>
1150 A temporary file will be created and used (this is the default). After the
1151 capturing is stopped, this file can be saved later under a user specified
1157 <term><command>Single named file</command></term>
1160 A single capture file will be used. If you want to place the new capture
1161 file to a specific folder, choose this mode.
1166 <term><command>Multiple files, continuous</command></term>
1169 Like the "Single named file" mode, but a new file is created and used,
1170 after reaching one of the multiple file switch conditions (one of the
1171 "Next file every ..." values).
1176 <term><command>Multiple files, ring buffer</command></term>
1179 Much like "Multiple files continuous", reaching one of the multiple files
1180 switch conditions (one of the "Next file every ..." values) will switch
1181 to the next file. This will be a newly created file if value of "Ring
1182 buffer with n files" is not reached, otherwise it will replace the oldest
1183 of the formerly used files (thus forming a "ring").
1186 This mode will limit the maximum disk usage, even for an unlimited amount of
1187 capture input data, keeping the latest captured data.
1194 <section id="ChCapLinkLayerHeader"><title>Link-layer header type</title>
1196 In the usual case, you won't have to choose this link-layer header type.
1197 The following paragraphs describe the exceptional cases, where
1198 selecting this type is possible, so you will have a guide of what to do:
1201 If you are capturing on an 802.11 device on some versions of BSD, this
1202 might offer a choice of "Ethernet" or "802.11". "Ethernet" will cause
1203 the captured packets to have fake Ethernet headers; "802.11" will cause
1204 them to have IEEE 802.11 headers. Unless the capture needs to be read by
1205 an application that doesn't support 802.11 headers, you should select
1209 If you are capturing on an Endace DAG card connected to a synchronous
1210 serial line, this might offer a choice of "PPP over serial" or
1211 "Cisco HDLC"; if the protocol on the serial line is PPP, select
1212 "PPP over serial", and if the protocol on the serial line is Cisco HDLC,
1213 select "Cisco HDLC".
1216 If you are capturing on an Endace DAG card connected to an ATM network,
1217 this might offer a choice of "RFC 1483 IP-over-ATM" or "Sun raw ATM".
1218 If the only traffic being captured is RFC 1483 LLC-encapsulated IP, or if
1219 the capture needs to be read by an application that doesn't support SunATM
1220 headers, select "RFC 1483 IP-over-ATM", otherwise select "Sun raw ATM".
1223 If you are capturing on an Ethernet device, this might offer a choice of
1224 "Ethernet" or "DOCSIS". If you are capturing traffic from a Cisco Cable
1225 Modem Termination System that is putting DOCSIS traffic onto the Ethernet
1226 to be captured, select "DOCSIS", otherwise select "Ethernet".
1230 <section id="ChCapCaptureFilterSection"><title>Filtering while capturing</title>
1232 Wireshark uses the libpcap filter language for capture filters.
1233 This is explained in the tcpdump man page, which can be hard to
1234 understand, so it's explained here to some extent.
1239 You will find a lot of Capture Filter examples at <ulink
1240 url="&WiresharkWikiCaptureFiltersPage;">&WiresharkWikiCaptureFiltersPage;</ulink>.
1244 You enter the capture filter into the Filter field of the Wireshark
1245 Capture Options dialog box, as shown in
1246 <xref linkend="ChCapCaptureOptionsDialog"/>. The following is an outline
1247 of the syntax of the <command>tcpdump</command> capture filter language.
1248 See the expression option at the tcpdump manual page for details:
1249 <ulink url="&TcpdumpManpage;"/>.
1252 A capture filter takes the form of a series of primitive expressions
1253 connected by conjunctions (<command>and/or</command>) and optionally
1254 preceded by <command>not</command>:
1256 [not] <command>primitive</command> [and|or [not] <command>primitive</command> ...]
1258 An example is shown in <xref linkend="ChCapExFilt1"/>.
1260 <example id="ChCapExFilt1">
1262 A capture filter for telnet that captures traffic to and from a
1266 tcp port 23 and host 10.0.0.5
1269 This example captures telnet traffic to and from the host
1270 10.0.0.5, and shows how to use two primitives and the
1271 <command>and</command> conjunction. Another example is shown in
1272 <xref linkend="ChCapExFilt2"/>, and shows how to capture all
1273 telnet traffic except that from 10.0.0.5.
1274 <example id="ChCapExFilt2">
1276 Capturing all telnet traffic not from 10.0.0.5</title>
1278 tcp port 23 and not src host 10.0.0.5
1284 XXX - add examples to the following list.
1287 A primitive is simply one of the following:
1290 <term><command>[src|dst] host <host></command></term>
1293 This primitive allows you to filter on a host IP
1294 address or name. You can optionally precede the
1295 primitive with the keyword <command>src|dst</command>
1296 to specify that you are only interested in source or
1297 destination addresses. If these are not present,
1298 packets where the specified address appears as either
1299 the source or the destination address will be selected.
1305 <command>ether [src|dst] host <ehost></command>
1309 This primitive allows you to filter on Ethernet host
1310 addresses. You can optionally include the keyword
1311 <command>src|dst</command> between the keywords
1312 <command>ether</command> and <command>host</command>
1313 to specify that you are only interested in source
1314 or destination addresses. If these are not present,
1315 packets where the specified address appears in either
1316 the source or destination address will be selected.
1321 <term><command>gateway host <host></command></term>
1324 This primitive allows you to filter on packets that
1325 used <command>host</command> as a gateway. That is, where
1326 the Ethernet source or destination was
1327 <command>host</command> but neither the source nor
1328 destination IP address was <command>host</command>.
1335 [src|dst] net <net> [{mask <mask>}|{len <len>}]
1340 This primitive allows you to filter on network numbers.
1341 You can optionally precede this primitive with the
1342 keyword <command>src|dst</command> to specify that you
1343 are only interested in a source or destination network.
1344 If neither of these are present, packets will be
1345 selected that have the specified network in either the
1346 source or destination address. In addition, you can
1347 specify either the netmask or the CIDR prefix for the
1348 network if they are different from your own.
1354 <command>[tcp|udp] [src|dst] port <port></command>
1358 This primitive allows you to filter on TCP and UDP port
1359 numbers. You can optionally precede this primitive with
1360 the keywords <command>src|dst</command> and
1361 <command>tcp|udp</command> which allow you to specify
1362 that you are only interested in source or destination
1363 ports and TCP or UDP packets respectively. The
1364 keywords <command>tcp|udp</command> must appear before
1365 <command>src|dst</command>.
1368 If these are not specified, packets will be selected
1369 for both the TCP and UDP protocols and when the
1370 specified address appears in either the source or
1371 destination port field.
1376 <term><command>less|greater <length></command></term>
1379 This primitive allows you to filter on packets whose
1380 length was less than or equal to the specified length,
1381 or greater than or equal to the specified length,
1387 <term><command>ip|ether proto <protocol></command></term>
1390 This primitive allows you to filter on the specified
1391 protocol at either the Ethernet layer or the IP layer.
1396 <term><command>ether|ip broadcast|multicast</command></term>
1399 This primitive allows you to filter on either
1400 Ethernet or IP broadcasts or multicasts.
1405 <term><command><expr> relop <expr></command></term>
1408 This primitive allows you to create complex filter
1409 expressions that select bytes or ranges of bytes in
1410 packets. Please see the tcpdump man page at
1411 <ulink url="&TcpdumpManpage;"/> for more details.
1417 <section id="ChCapCaptureAutoFilterSection">
1418 <title>Automatic Remote Traffic Filtering</title>
1420 If Wireshark is running remotely (using e.g. SSH, an exported X11 window,
1421 a terminal server, ...), the remote content has to be transported over
1422 the network, adding a lot of (usually unimportant) packets to the actually
1423 interesting traffic.
1426 To avoid this, Wireshark tries to figure out if it's remotely connected
1427 (by looking at some specific environment variables) and automatically
1428 creates a capture filter that matches aspects of the connection.
1431 The following environment variables are analyzed:
1435 <term><command>SSH_CONNECTION</command> (ssh)</term>
1438 <remote IP> <remote port> <local IP> <local port>
1444 <term><command>SSH_CLIENT</command> (ssh)</term>
1447 <remote IP> <remote port> <local port>
1453 <term><command>REMOTEHOST</command> (tcsh, others?)</term>
1462 <term><command>DISPLAY</command> (x11)</term>
1465 [remote name]:<display num>
1470 <term><command>SESSIONNAME</command> (terminal server)</term>
1479 On Windows it asks the operating system if it's running in a Remote Desktop Services
1485 <section id="ChCapRunningSection"><title>While a Capture is running ...</title>
1487 While a capture is running, the following dialog box is shown:
1488 <figure id="ChCapCaptureInfoDialog">
1489 <title>The "Capture Info" dialog box</title>
1490 <graphic entityref="WiresharkCaptureInfoDialog" format="JPG"/>
1492 This dialog box will inform you about the number of captured packets and
1493 the time since the capture was started. The selection of which protocols
1494 are counted cannot be changed.
1496 <tip><title>Tip!</title>
1498 This Capture Info dialog box can be hidden, using the "Hide capture info
1499 dialog" option in the Capture Options dialog box.
1502 <section id="ChCapStopSection"><title>Stop the running capture</title>
1504 A running capture session will be stopped in one of the following ways:
1508 "<inlinegraphic entityref="WiresharkToolbarCaptureStop" format="PNG"/>
1509 Stop" button from the <command>Capture Info dialog box
1512 <note><title>Note!</title>
1514 The Capture Info dialog box might be hidden, if the option "Hide capture
1515 info dialog" is used.
1520 <para>Using the <command>menu item</command>
1521 "Capture/<inlinegraphic entityref="WiresharkToolbarCaptureStop" format="PNG"/>
1526 <para>Using the <command>toolbar item</command>
1527 "<inlinegraphic entityref="WiresharkToolbarCaptureStop" format="PNG"/>
1532 <para>Pressing the accelerator keys: <command>Ctrl+E</command>.
1536 <para>The capture will be automatically stopped, if one of the
1537 <command>Stop Conditions</command> is exceeded, e.g. the maximum amount
1538 of data was captured.
1544 <section id="ChCapRestartSection"><title>Restart a running capture</title>
1546 A running capture session can be restarted with the same capture options
1547 as the last time, this will remove all packets previously captured.
1548 This can be useful, if some uninteresting packets are captured and
1549 there's no need to keep them.
1552 Restart is a convenience function and
1553 equivalent to a capture stop following by an immediate capture start.
1554 A restart can be triggered in one of the following ways:
1557 <para>Using the <command>menu item</command>
1558 "Capture/<inlinegraphic entityref="WiresharkToolbarCaptureRestart" format="PNG"/>
1563 <para>Using the <command>toolbar item</command>
1564 "<inlinegraphic entityref="WiresharkToolbarCaptureRestart" format="PNG"/>
1574 <!-- End of WSUG Chapter Capture -->