drsuapi_dissect_element_DsReplicaObjectIdentifier_dn parents append
[wireshark-sm.git] / doc / wsug_src / wsug_advanced.adoc
blob17e270b50546a24d227e685f4e2196ddffd80ce6
1 // WSUG Chapter Advanced
3 [#ChapterAdvanced]
5 == Advanced Topics
7 [#ChAdvIntroduction]
9 === Introduction
11 This chapter will describe some of Wireshark’s advanced features.
13 // We switched from FollowTCP to FollowStream in June 2018.
14 // This is apparently how you assign multiple anchors.
15 // https://docs.asciidoctor.org/asciidoc/latest/attributes/id/#add-additional-anchors-to-a-section
17 [#ChAdvFollowStreamSection]
18 === [[ChAdvFollowTCPSection]]Following Protocol Streams
20 It can be very helpful to see a protocol in the way that the application
21 layer sees it. Perhaps you are looking for passwords in a Telnet stream,
22 or you are trying to make sense of a data stream. Maybe you just need a
23 display filter to show only the packets in a TLS or SSL stream. If so,
24 Wireshark’s ability to follow protocol streams will be useful to you.
26 To filter to a particular stream,
27 select a packet in the packet list of the stream/connection you are
28 interested in and then select the menu item you want under menu:Analyze[Follow]
29 (or in the context menu in the packet list). Wireshark will set an
30 appropriate display filter and display a dialog box with the data from the
31 stream laid out, as shown in <<ChAdvFollowStream>>.
33 [TIP]
34 ====
35 Following a protocol stream applies a display filter which selects all
36 the packets in the current stream. Some people open the “Follow TCP
37 Stream” dialog and immediately close it as a quick way to isolate a
38 particular stream. Closing the dialog with the “Back” button will reset
39 the display filter if this behavior is not desired.
40 ====
42 Wireshark supports following the streams of many different protocols, including
43 TCP, UDP, DCCP, TLS, HTTP, HTTP/2, QUIC, WebSocket, SIP, and USB CDC.
44 The dialog for following TCP streams is covered in detail here;
45 most other supported protocols will show dialogs which are very similar.
47 [NOTE]
48 ====
49 If the type of stream you wish to follow is disabled or missing from the menu,
50 Wireshark did not find the respective protocol in the currently selected packet.
51 ====
53 [TIP]
54 ====
55 To follow TLS or SSL streams, see the wiki page on
56 link:{wireshark-wiki-url}TLS[TLS] for instructions
57 on providing TLS keys.
58 ====
60 [#ChAdvFollowStream]
62 .The “Follow TCP Stream” dialog box
63 image::images/ws-follow-stream.png[{screenshot-attrs}]
65 The stream content is displayed in the same sequence as it appeared on the
66 network. Non-printable characters are replaced by dots.
67 Traffic from the client to the server is colored red, while traffic
68 from the server to the client is
69 colored blue. These colors can be changed by opening menu:Edit[Preferences] and
70 under menu:Appearance[Font and Colors], selecting different colors for the
71 btn:[Sample "Follow Stream" client text] and btn:[Sample "Follow Stream" server text]
72 options.
76 // XXX - What about line wrapping (maximum line length) and CRNL conversions?
78 The stream content won’t be updated while doing a live capture. To get the
79 latest content you’ll have to reopen the dialog.
81 You can choose from the following actions:
83 btn:[Help]:: Show this help.
85 btn:[Filter out this stream]:: Apply a display filter removing the current
86   stream data from the display.
88 btn:[Print]:: Print the stream data in the currently selected format.
90 btn:[Save as...]:: Save the stream data in the currently selected format.
92 btn:[Back]:: Close this dialog box and restore the previous display filter.
94 btn:[Close]:: Close this dialog box, leaving the current display filter in
95   effect.
97 By default, Wireshark displays both client and server data. You can select the
98 menu:Entire conversation[] to switch between both, client to server, or
99 server to client data.
101 You can choose to view the data in one of the following formats:
103 menu:ASCII[]:: In this view you see the data from each direction in ASCII.
104   Obviously best for ASCII based protocols, e.g., HTTP.
106 menu:C Arrays[]:: This allows you to import the stream data into your own C
107   program.
109 menu:EBCDIC[]:: For the big-iron freaks out there.
111 menu:HEX Dump[]:: This allows you to see all the data. This will require a lot of
112   screen space and is best used with binary protocols.
114 menu:UTF-8[]:: Like ASCII, but decode the data as UTF-8.
116 menu:UTF-16[]:: Like ASCII, but decode the data as UTF-16.
118 menu:YAML[]:: This allows you to load the stream as YAML.
120 The YAML output is divided into 2 main sections:
122 * The `peers` section where for each `peer` you found the peer index, the `host` address and the `port` number.
124 * The `packets` section where for each `packet` you found the packet number in the original capture, the `peer` index,
125 the packet `index` for this peer, the `timestamp` in seconds and the `data` in base64 encoding.
127 .Follow Stream YAML output
128 ====
129 [source,yaml]
130 ----
131 peers:
132   - peer: 0
133     host: 127.0.0.1
134     port: 54048
135   - peer: 1
136     host: 127.0.10.1
137     port: 5000
138 packets:
139   - packet: 1
140     peer: 0
141     index: 0
142     timestamp: 1599485409.693955274
143     data: !!binary |
144       aGVsbG8K
145   - packet: 3
146     peer: 1
147     index: 0
148     timestamp: 1599485423.885866692
149     data: !!binary |
150       Ym9uam91cgo=
151 ----
152 ====
154 The same example but in old YAML format (before version 3.5):
155 [source,yaml]
156 ----
157 # Packet 1
158 peer0_0: !!binary |
159   aGVsbG8K
160 # Packet 3
161 peer1_0: !!binary |
162   Ym9uam91cgo=
163 ----
165 How the old format data can be found in the new format:
166 [options="header"]
167 |===
168 |New YAML format |Old YAML format |
170 ----
172 packets:
173   - packet: AAA
174     peer: BBB
175     index: CCC
176     data: !!binary \|
177       DDD
178 ----
180 ----
181 # Packet AAA
182 peerBBB_CCC !!binary \|
183   DDD
184 ----
186  AAA: packet number in the original capture
187  BBB: peer index
188  CCC: packet index for this peer
189  DDD: data in base64 encoding
190 |===
192 menu:Raw[]:: This allows you to load the unaltered stream data into a different
193   program for further examination. The display will show the data as strings
194   of hex characters with each frame on a separate line, but “Save As”
195   will result in a binary file without any added line separators.
197 You can optionally show the delta time each time the direction changes (turns) or for every packet or event.
199 You can switch between streams using the “Stream” selector.
201 You can search for text by entering it in the “Find” entry box and
202 pressing btn:[Find Next].
204 .The “Follow HTTP/2 Stream” dialog box
205 image::images/ws-follow-http2-stream.png[{screenshot-attrs}]
207 The HTTP/2 Stream dialog is similar to the "Follow TCP Stream" dialog, except
208 for an additional "Substream" dialog field. HTTP/2 Streams are identified by
209 a HTTP/2 Stream Index (field name `http2.streamid`) which are unique within a
210 TCP connection. The “Stream” selector determines the TCP connection whereas the
211 “Substream” selector is used to pick the HTTP/2 Stream ID.
213 The QUIC protocol is similar, the first number selects the QUIC connection number
214 while the "Substream" field selects the QUIC Stream ID.
216 .The “Follow SIP Call” dialog box
217 image::images/ws-follow-sip-stream.png[{screenshot-attrs}]
219 The SIP call is shown with same dialog, just filter is based on sip.Call-ID
220 field. Count of streams is fixed to 0 and the field is disabled.
222 [#ChAdvShowPacketBytes]
224 === Show Packet Bytes
226 If a selected packet field does not show all the bytes (i.e., they are truncated
227 when displayed) or if they are shown as bytes rather than string or if they require
228 more formatting because they contain an image or HTML then this dialog can be used.
230 This dialog can also be used to decode field bytes from base64, various compressed
231 formats or quoted-printable and show the decoded bytes as configurable output.
232 It’s also possible to select a subset of bytes setting the start byte and end byte.
234 You can choose from the following actions:
236 btn:[Help]:: Show this help.
238 btn:[Print]:: Print the bytes in the currently selected format.
240 btn:[Copy]:: Copy the bytes to the clipboard in the currently selected format.
242 btn:[Save As]:: Save the bytes in the currently selected format.
244 btn:[Close]:: Close this dialog box.
246 You can choose to decode the data from one of the following formats:
248 menu:None[]:: This is the default which does not decode anything.
250 menu:Base64[]:: This will decode from Base64 or Base64Url.
252 menu:Compressed[]:: This will decompress the buffer using lz77, lz77huff, lznt1, snappy, zlib or zstd.
254 menu:Hex Digits[]:: This will decode from a string of hex digits. Non-hex characters are skipped.
256 menu:Percent-Encoding[]:: This will decode from a Percent-Encoded string.
258 menu:Quoted-Printable[]:: This will decode from a Quoted-Printable string.
260 menu:ROT-13[]:: This will decode ROT-13 encoded text.
262 You can choose to view the data in one of the following formats:
264 menu:ASCII[]:: In this view you see the bytes as ASCII.
265   All control characters and non-ASCII bytes are replaced by dot.
267 menu:ASCII & Control[]:: In this view all control characters are shown using a
268   UTF-8 symbol and all non-ASCII bytes are replaced by dot.
270 menu:C Array[]:: This allows you to import the field data into your own C program.
272 menu:EBCDIC[]:: For the big-iron freaks out there.
274 menu:Hex Dump[]:: This allows you to see all the data. This will require a lot of
275   screen space and is best used with binary protocols.
277 menu:HTML[]:: This allows you to see all the data formatted as a HTML document.
278   The HTML supported is what’s supported by the Qt QTextEdit class.
280 menu:Image[]:: This will try to convert the bytes into an image.
281   Most popular formats are supported including PNG, JPEG, GIF, and BMP.
283 menu:ISO 8859-1[]:: In this view you see the bytes as ISO 8859-1.
285 menu:Raw[]:: This allows you to load the bytes into a different
286   program for further examination. The display will show HEX data, but
287   “Save As” will result in a binary file.
289 menu:UTF-8[]:: In this view you see the bytes as UTF-8.
291 menu:UTF-16[]:: In this view you see the bytes as UTF-16.
293 menu:YAML[]:: This will show the bytes as a YAML binary dump.
295 You can search for text by entering it in the “Find” entry box and
296 pressing btn:[Find Next].
298 [#ChAdvExpert]
300 === Expert Information
302 Wireshark keeps track of any anomalies and other items of interest it finds in a capture file and shows them in the Expert Information dialog.
303 The goal is to give you a better idea of uncommon or notable network behavior and to let novice and expert users find network problems faster than manually scanning through the packet list.
305 [WARNING]
306 .Expert information is only a hint
307 ====
308 Expert information is the starting point for investigation, not the stopping point.
309 Every network is different, and it's up to you to verify that Wireshark’s expert information applies to your particular situation.
310 The presence of expert information doesn't necessarily indicate a problem and absence of expert information doesn’t necessarily mean everything is OK.
311 ====
313 The amount of expert information largely depends on the protocol being used.
314 While dissectors for some common protocols like TCP and IP will show detailed information, other dissectors will show little or none.
316 The following describes the components of a single expert information entry along with the expert user interface.
318 [#ChAdvExpertInfoEntries]
320 ==== Expert Information Entries
322 Expert information entries are grouped by severity level (described below) and contain the following:
324 [#ChAdvTabExpertInfoEntries]
326 .Example expert information items
327 [options="header"]
328 |===
329 |Packet #|Summary|Group|Protocol
330 |592|TCP: [TCP Out-Of-Order] ...|Malformed|TCP
331 |1202|DNS: Standard query response ...|Protocol|DNS
332 |443|TCP: 80 → 59322 [RST] Seq=12761 Win=0 Len=0|Sequence|TCP
333 |===
335 [#ChAdvExpertSeverity]
337 ===== Severity
339 Every expert information item has a severity level.
340 The following levels are used, from lowest to highest.
341 Wireshark marks them using different colors, which are shown in parentheses:
343 Chat [white blue-background]#(blue)#::
344 Information about usual workflow, e.g., a TCP packet with the SYN flag set.
346 Note [black aqua-background]#(cyan)#::
347 Notable events, e.g., an application returned a common error code such as HTTP 404.
349 Warn [black yellow-background]#(yellow)#::
350 Warnings, e.g., application returned an unusual error code like a connection problem.
352 Error [white red-background]#(red)#::
353 Serious problems, such as malformed packets.
355 [#ChAdvExpertGroup]
357 ===== Summary
359 Short explanatory text for each expert information item.
361 ===== Group
363 Along with severity levels, expert information items are categorized by group.
364 The following groups are currently implemented:
366 Assumption::
367 The protocol field has incomplete data and was dissected based on assumed value.
369 Checksum::
370 A checksum was invalid.
372 Comment::
373 Packet comment.
375 Debug::
376 Debugging information.
377 You shouldn’t see this group in release versions of Wireshark.
379 Decryption::
380 A decryption issue.
382 Deprecated::
383 The protocol field has been deprecated.
385 Malformed::
386 Malformed packet or dissector has a bug.
387 Dissection of this packet aborted.
389 Protocol::
390 Violation of a protocol’s specification (e.g., invalid field values or illegal lengths).
391 Dissection of this packet probably continued.
393 Reassemble::
394 Problems while reassembling, e.g., not all fragments were available or an exception happened during reassembly.
396 Request Code::
397 An application request (e.g., File Handle == _x_). Usually assigned the Chat severity level.
399 Response Code::
400 An application response code indicates a potential problem, e.g., HTTP 404 page not found.
402 Security::
403 A security problem, e.g., an insecure implementation.
405 Sequence::
406 A protocol sequence number was suspicious, e.g., it wasn’t continuous or a retransmission was detected.
408 Undecoded::
409 Dissection incomplete or data can’t be decoded for other reasons.
411 It’s possible that more groups will be added in the future.
413 [#ChAdvExpertProtocol]
415 ===== Protocol
417 The protocol dissector that created the expert information item.
419 [#ChAdvExpertSummary]
421 [#ChAdvExpertDialog]
423 ==== The “Expert Information” Dialog
425 You can open the expert info dialog by selecting menu:Analyze[Expert Info] or by clicking the expert level indicator in the main status bar.
427 Right-clicking on an item will allow you to apply or prepare a filter based on the item, copy its summary text, and other tasks.
429 .The “Expert Information” dialog box
430 image::images/ws-expert-information.png[{screenshot-attrs}]
432 You can choose from the following actions:
434 Limit to display filter::
435 Only show expert information items present in packets that match the current display filter.
437 Group by summary::
438 Group items by their summary instead of the groups described above.
440 Search::
441 Only show items that match the search string, such as “dns”.
442 Regular expressions are supported.
444 menu:Show...[]::
445 Lets you show or hide each severity level.
446 For example, you can deselect Chat and Note severities if desired.
448 btn:[Help]::
449 Takes you to this section of the User’s Guide.
451 btn:[Close]::
452 Closes the dialog
454 // ===== Errors / Warnings / Notes / Chats tabs
456 // An easy and quick way to find the most interesting infos (rather than using the
457 // Details tab), is to have a look at the separate tabs for each severity level. As
458 // the tab label also contains the number of existing entries, it’s easy to find
459 // the tab with the most important entries.
461 // There are usually a lot of identical expert infos only differing in the packet
462 // number. These identical infos will be combined into a single line - with a count
463 // column showing how often they appeared in the capture file. Clicking on the plus
464 // sign shows the individual packet numbers in a tree view.
466 // [[ChAdvExpertDialogDetails]]
468 // ===== Details tab
470 // The Details tab provides the expert infos in a “log like” view, each entry on
471 // its own line (much like the packet list). As the amount of expert infos for a
472 // capture file can easily become very large, getting an idea of the interesting
473 // infos with this view can take quite a while. The advantage of this tab is to
474 // have all entries in the sequence as they appeared, this is sometimes a help to
475 // pinpoint problems.
477 [#ChAdvExpertColorizedTree]
479 ==== “Colorized” Protocol Details Tree
481 .The “Colorized” protocol details tree
482 image::images/ws-expert-colored-tree.png[{screenshot-attrs}]
484 The packet detail tree marks fields with expert information based on their severity level color, e.g., “Warning” severities have a yellow background.
485 This color is propagated to the top-level protocol item in the tree in order to make it easy to find the field that created the expert information.
487 For the example screenshot above, the IP “Time to live” value is very low (only 1), so the corresponding protocol field is marked with a cyan background.
488 To make it easier find that item in the packet tree, the IP protocol toplevel item is marked cyan as well.
490 [#ChAdvExpertColumn]
492 ==== “Expert” Packet List Column (Optional)
494 .The “Expert” packet list column
495 image::images/ws-expert-column.png[{screenshot-attrs}]
497 An optional “Expert Info Severity” packet list column is available that
498 displays the most significant severity of a packet or stays empty if everything
499 seems OK. This column is not displayed by default but can be easily added using
500 the Preferences Columns page described in <<ChCustPreferencesSection>>.
502 [#ChAdvTCPAnalysis]
504 === TCP Analysis
506 By default, Wireshark’s TCP dissector tracks the state of each TCP
507 session and provides additional information when problems or potential
508 problems are detected. Analysis is done once for each TCP packet when a
509 capture file is first opened. Packets are processed in the order in
510 which they appear in the packet list. You can enable or disable this
511 feature via the “Analyze TCP sequence numbers” TCP dissector preference.
513 For analysis of data or protocols layered on top of TCP (such as HTTP), see
514 <<ChAdvReassemblyTcp>>.
516 .“TCP Analysis” packet detail items
517 image::images/ws-tcp-analysis.png[{screenshot-attrs}]
519 TCP Analysis flags are added to the TCP protocol tree under “SEQ/ACK
520 analysis”. Each flag is described below. Terms such as “next expected
521 sequence number” and “next expected acknowledgment number” refer to
522 the following”:
524 // tcp_analyze_seq_info->nextseq
525 Next expected sequence number:: The last-seen sequence number plus
526 segment length. Set when there are no analysis flags and for zero
527 window probes. This is initially zero and calculated based on the
528 previous packet in the same TCP flow. Note that this may not be the same
529 as the tcp.nxtseq protocol field.
531 // tcp_analyze_seq_info->maxseqtobeacked
532 Next expected acknowledgment number:: The last-seen sequence number for
533 segments. Set when there are no analysis flags and for zero window probes.
535 // tcp_analyze_seq_info->lastack
536 Last-seen acknowledgment number:: Always updated for each packet. Note
537 that this is not the same as the next expected acknowledgment number.
539 // TCP_A_ACK_LOST_PACKET
540 [discrete]
541 ==== TCP ACKed unseen segment
543 Set when the expected next acknowledgment number is set for the reverse
544 direction and it’s less than the current acknowledgment number.
546 // TCP_A_DUPLICATE_ACK
547 [discrete]
548 ==== TCP Dup ACK __<frame>__#__<acknowledgment number>__
550 Set when all of the following are true:
552 * The segment size is zero.
553 * The window size is non-zero and hasn’t changed, or there is valid SACK data.
554 * The next expected sequence number and last-seen acknowledgment number are non-zero (i.e., the connection has been established).
555 * SYN, FIN, and RST are not set.
557 // TCP_A_FAST_RETRANSMISSION
558 [discrete]
559 ==== TCP Fast Retransmission
561 Set when all of the following are true:
563 * This is not a keepalive packet.
564 * In the forward direction, the segment size is greater than zero or the SYN or FIN is set.
565 * The next expected sequence number is greater than the current sequence number.
566 * We have at least two duplicate ACKs in the reverse direction.
567 * The current sequence number equals the next expected acknowledgment number.
568 * We saw the last acknowledgment less than 20ms ago.
570 Supersedes “Out-Of-Order” and “Retransmission”.
572 // TCP_A_KEEP_ALIVE
573 [discrete]
574 ==== TCP Keep-Alive
576 Set when the segment size is zero or one, the current sequence number
577 is one byte less than the next expected sequence number, and none of SYN,
578 FIN, or RST are set.
580 Supersedes “Fast Retransmission”, “Out-Of-Order”, “Spurious
581 Retransmission”, and “Retransmission”.
583 // TCP_A_KEEP_ALIVE_ACK
584 [discrete]
585 ==== TCP Keep-Alive ACK
587 Set when all of the following are true:
589 * The segment size is zero.
590 * The window size is non-zero and hasn’t changed.
591 * The current sequence number is the same as the next expected sequence number.
592 * The current acknowledgment number is the same as the last-seen acknowledgment number.
593 * The most recently seen packet in the reverse direction was a keepalive.
594 * The packet is not a SYN, FIN, or RST.
596 Supersedes “Dup ACK” and “ZeroWindowProbeAck”.
598 // TCP_A_OUT_OF_ORDER
599 [discrete]
600 ==== TCP Out-Of-Order
602 Set when all of the following are true:
604 * This is not a keepalive packet.
605 * In the forward direction, the segment length is greater than zero or the SYN or FIN is set.
606 * The next expected sequence number is greater than the current sequence number.
607 * The next expected sequence number and the next sequence number differ.
608 * The last segment arrived within the Out-Of-Order RTT threshold.
609   The threshold is either the value shown in the “iRTT” (tcp.analysis.initial_rtt) field under “SEQ/ACK analysis” if it is present, or the default value of 3ms if it is not.
611 Supersedes “Retransmission”.
613 // TCP_A_REUSED_PORTS
614 [discrete]
615 ==== TCP Port numbers reused
617 Set when the SYN flag is set (not SYN+ACK), we have an existing conversation using the same addresses and ports, and the sequence number is different than the existing conversation’s initial sequence number.
619 // TCP_A_LOST_PACKET
620 [discrete]
621 ==== TCP Previous segment not captured
623 Set when the current sequence number is greater than the next expected sequence number.
625 // TCP_A_SPURIOUS_RETRANSMISSION
626 [discrete]
627 ==== TCP Spurious Retransmission
629 Checks for a retransmission based on analysis data in the reverse
630 direction. Set when all of the following are true:
632 * The SYN or FIN flag is set.
633 * This is not a keepalive packet.
634 * The segment length is greater than zero.
635 * Data for this flow has been acknowledged. That is, the last-seen acknowledgment number has been set.
636 * The next sequence number is less than or equal to the last-seen acknowledgment number.
638 Supersedes “Fast Retransmission”, “Out-Of-Order”, and “Retransmission”.
640 // TCP_A_RETRANSMISSION
641 [discrete]
642 ==== TCP Retransmission
644 Set when all of the following are true:
646 * This is not a keepalive packet.
647 * In the forward direction, the segment length is greater than zero or the SYN or FIN flag is set.
648 * The next expected sequence number is greater than the current sequence number.
650 // TCP_A_WINDOW_FULL
651 [discrete]
652 ==== TCP Window Full
654 Set when the segment size is non-zero, we know the window size in the
655 reverse direction, and our segment size exceeds the window size in the
656 reverse direction.
658 // TCP_A_WINDOW_UPDATE
659 [discrete]
660 ==== TCP Window Update
662 Set when the all of the following are true:
664 * The segment size is zero.
665 * The window size is non-zero and not equal to the last-seen window size, and there is no valid SACK data.
666 * The sequence number is equal to the next expected sequence number.
667 * The acknowledgment number is equal to the last-seen acknowledgment number,
668 * or to the next expected sequence number when answering to a ZeroWindowProbe.
669 * None of SYN, FIN, or RST are set.
671 // TCP_A_ZERO_WINDOW
672 [discrete]
673 ==== TCP ZeroWindow
675 Set when the receive window size is zero and none of SYN, FIN, or RST are set.
677 The _window_ field in each TCP header advertises the amount of data a receiver can accept.
678 If the receiver can’t accept any more data it will set the window value to zero, which tells the sender to pause its transmission.
679 In some specific cases this is normal -- for example, a printer might use a zero window to pause the transmission of a print job while it loads or reverses a sheet of paper.
680 However, in most cases this indicates a performance or capacity problem on the receiving end.
681 It might take a long time (sometimes several minutes) to resume a paused connection, even if the underlying condition that caused the zero window clears up quickly.
683 // TCP_A_ZERO_WINDOW_PROBE
684 [discrete]
685 ==== TCP ZeroWindowProbe
687 Set when the sequence number is equal to the next expected sequence
688 number, the segment size is one, and last-seen window size in the
689 reverse direction was zero.
691 If the single data byte from a Zero Window Probe is dropped by the receiver (not
692 ACKed), then a subsequent segment should not be flagged as retransmission if all
693 of the following conditions are true for that segment:
694 * The segment size is larger than one.
695 * The next expected sequence number is one less than the current sequence number.
697 This affects “Fast Retransmission”, “Out-Of-Order”, or “Retransmission”.
699 // TCP_A_ZERO_WINDOW_PROBE_ACK
700 [discrete]
701 ==== TCP ZeroWindowProbeAck
703 Set when the all of the following are true:
705 * The segment size is zero.
706 * The window size is zero.
707 * The sequence number is equal to the next expected sequence number.
708 * The acknowledgment number is equal to the last-seen acknowledgment number.
709 * The last-seen packet in the reverse direction was a zero window probe.
711 Supersedes “TCP Dup ACK”.
713 // TCP_A_AMBIGUOUS_INTERPRETATIONS
714 [discrete]
715 ==== TCP Ambiguous Interpretations
717 Some captures are quite difficult to analyze automatically, particularly when the
718 time frame may cover both Fast Retransmission and Out-Of-Order packets. A TCP
719 preference allows to switch the precedence of these two interpretations at the
720 protocol level.
722 // TCP_A_CONVERSATION_COMPLETENESS
723 [discrete]
724 ==== TCP Conversation Completeness
726 TCP conversations are said to be complete when they have both opening and closing
727 handshakes, independently of any data transfer. However, we might be interested in
728 identifying complete conversations with some data sent, and we are using the
729 following bit values to build a filter value on the tcp.completeness field :
731 * 1 : SYN
732 * 2 : SYN-ACK
733 * 4 : ACK
734 * 8 : DATA
735 * 16 : FIN
736 * 32 : RST
738 For example, a conversation containing only a three-way handshake will be found
739 with the filter 'tcp.completeness==7' (1+2+4) while a complete conversation with
740 data transfer will be found with a longer filter as closing a connection can be
741 associated with FIN or RST packets, or even both :
742 'tcp.completeness==31 or tcp.completeness==47 or tcp.completeness==63'
744 Another way to select specific conversation values is to filter on individual
745 flags, the summary field, or a combination of them.
746 Thus, '(tcp.completeness.fin==1 || tcp.completeness.rst==1) && tcp.completeness.str contains "DASS"'
747 will find all 'Complete, WITH_DATA' conversations, while the 'Complete, NO_DATA'
748 ones will be found with
749 '(tcp.completeness.fin==1 || tcp.completeness.rst==1) && tcp.completeness.data==0 && tcp.completeness.str contains "ASS"'.
751 [#ChAdvTimestamps]
753 === Time Stamps
755 Time stamps, their precisions and all that can be quite confusing. This section
756 will provide you with information about what’s going on while Wireshark
757 processes time stamps.
759 While packets are captured, each packet is time stamped as it comes in. These
760 time stamps will be saved to the capture file, so they also will be available
761 for (later) analysis.
763 So where do these time stamps come from? While capturing, Wireshark gets the
764 time stamps from the libpcap (Npcap) library, which in turn gets them from the
765 operating system kernel. If the capture data is loaded from a capture file,
766 Wireshark obviously gets the data from that file.
768 ==== Wireshark Internals
770 The internal format that Wireshark uses to keep a packet time stamp consists of
771 the date (in days since 1.1.1970) and the time of day (in nanoseconds since
772 midnight). You can adjust the way Wireshark displays the time stamp data in the
773 packet list, see the “Time Display Format” item in the
774 <<ChUseViewMenuSection>> for details.
776 While reading or writing capture files, Wireshark converts the time stamp data
777 between the capture file format and the internal format as required.
779 While capturing, Wireshark uses the libpcap (Npcap) capture library which
780 supports nanosecond resolution for both pcapng and pcap files, though some
781 devices may only provide microsecond resolution, in which case that will be
782 used. Unless you are working with specialized capturing hardware, this
783 resolution should be adequate.
785 ==== Capture File Formats
787 The vast majority of capture file formats that Wireshark knows support time
788 stamps.  The time stamp precision supported by a specific capture file format
789 differs widely and varies from one second “0” to one nanosecond “0.123456789”.
790 Most file formats store the time stamps with a fixed precision (e.g., microseconds,
791 “0.123456”), while some file formats are capable of storing the time stamp
792 precision itself or even having a different precision for different records
793 in the file (whatever the benefit may be).
795 The pcapng capture file format supports a wide range of time stamp resolutions,
796 which can be different for each interface in the file, as well as records without
797 time stamps. The common libpcap capture file format, which is widely supported by
798 many other tools, supports two possible fixed resolutions, microsecond or
799 nanosecond, indicated by a magic number at the start of the file. Wireshark and
800 tools like editcap can convert pcap files with nanosecond resolution to microsecond
801 resolution for use with tools that only support the original time stamp precision.
803 Writing data into a capture file format that doesn’t provide the capability to
804 store the actual precision will lead to loss of information. For example, if you
805 load a capture file with nanosecond resolution and store the capture data in a
806 libpcap file (with microsecond resolution) Wireshark obviously must reduce the
807 precision from nanosecond to microsecond.
809 ==== Accuracy
811 People often ask “Which time stamp accuracy is provided by Wireshark?”. Well,
812 Wireshark doesn’t create any time stamps itself but simply gets them from
813 “somewhere else” and displays them. So accuracy will depend on the capture
814 system (operating system, performance, etc.) that you use. Because of this, the
815 above question is difficult to answer in a general way.
817 [NOTE]
818 ====
819 USB connected network adapters often provide a very bad time stamp accuracy. The
820 incoming packets have to take “a long and winding road” to travel through the
821 USB cable until they actually reach the kernel. As the incoming packets are time
822 stamped when they are processed by the kernel, this time stamping mechanism
823 becomes very inaccurate.
825 Don’t use USB connected NICs when you need precise time stamp
826 accuracy.
827 ====
829 // (XXX - are there any such NIC’s that generate time stamps on the USB
830 // hardware?)
832 [#ChAdvTimezones]
834 === Time Zones
836 If you travel across the planet, time zones can be confusing. If you get a
837 capture file from somewhere around the world time zones can even be a lot more
838 confusing ;-)
840 First of all, there are two reasons why you may not need to think about time
841 zones at all:
843 * You are only interested in the time differences between the packet time stamps
844   and don’t need to know the exact date and time of the captured packets (which
845   is often the case).
847 * You don’t get capture files from different time zones than your own, so there
848   are simply no time zone problems. For example, everyone in your team is
849   working in the same time zone as yourself.
851 .What are time zones?
852 ****
853 People expect that the time reflects the sunset. Dawn should be in the morning
854 maybe around 06:00 and dusk in the evening maybe at 20:00. These times will
855 obviously vary depending on the season. It would be very confusing if everyone
856 on earth would use the same global time as this would correspond to the sunset
857 only at a small part of the world.
859 For that reason, the earth is split into several different time zones, each zone
860 with a local time that corresponds to the local sunset.
862 The time zone’s base time is UTC (Coordinated Universal Time) or Zulu Time
863 (military and aviation). The older term GMT (Greenwich Mean Time) shouldn’t be
864 used as it is slightly incorrect (up to 0.9 seconds difference to UTC). The UTC
865 base time equals to 0 (based at Greenwich, England) and all time zones have an
866 offset to UTC between -12 to +14 hours!
868 For example: If you live in Berlin, you are in a time zone one hour earlier than
869 UTC, so you are in time zone “+1” (time difference in hours compared to UTC).
870 If it’s 3 o’clock in Berlin it’s 2 o’clock in UTC “at the same moment”.
872 Be aware that at a few places on earth don’t use time zones with even hour
873 offsets (e.g., New Delhi uses UTC+05:30)!
875 Further information can be found at: {wikipedia-main-url}Time_zone and
876 {wikipedia-main-url}Coordinated_Universal_Time.
877 ****
879 .What is daylight saving time (DST)?
880 ****
881 Daylight Saving Time (DST), also known as Summer Time is intended to “save”
882 some daylight during the summer months. To do this, a lot of countries (but not
883 all!) add a DST hour to the already existing UTC offset. So you may need to take
884 another hour (or in very rare cases even two hours!) difference into your “time
885 zone calculations”.
887 Unfortunately, the date at which DST actually takes effect is different
888 throughout the world. You may also note, that the northern and southern
889 hemispheres have opposite DST’s (e.g., while it’s summer in Europe it’s winter in
890 Australia).
892 Keep in mind: UTC remains the same all year around, regardless of DST!
894 Further information can be found at
895 link:{wikipedia-main-url}Daylight_saving[].
896 ****
898 Further time zone and DST information can be found at
899 {greenwichmeantime-main-url} and {timeanddate-main-url}.
901 [discrete]
902 ==== Set your computer’s time correctly!
904 If you work with people around the world it’s very helpful to set your
905 computer’s time and time zone right.
907 You should set your computers time and time zone in the correct sequence:
909 . Set your time zone to your current location
911 . Set your computer’s clock to the local time
913 This way you will tell your computer both the local time and also the time
914 offset to UTC. Many organizations simply set the time zone on their servers and
915 networking gear to UTC in order to make coordination and troubleshooting easier.
917 [TIP]
918 ====
919 If you travel around the world, it’s an often-made mistake to adjust the hours
920 of your computer clock to the local time. Don’t adjust the hours but your time
921 zone setting instead! For your computer, the time is essentially the same as
922 before, you are simply in a different time zone with a different local time.
923 ====
925 You can use the Network Time Protocol (NTP) to automatically adjust your
926 computer to the correct time, by synchronizing it to Internet NTP clock servers.
927 NTP clients are available for all operating systems that Wireshark supports (and
928 for a lot more), for examples see {ntp-main-url}.
931 ==== Wireshark and Time Zones
933 So what’s the relationship between Wireshark and time zones anyway?
935 Wireshark’s native capture file format (libpcap format), and some
936 other capture file formats, such as the Windows Sniffer, *Peek, Sun
937 snoop formats, and newer versions of the Microsoft Network Monitor and
938 Network Instruments/Viavi Observer formats, save the arrival time of
939 packets as UTC values.  UN*X systems, and “Windows NT based” systems
940 represent time internally as UTC.  When Wireshark is capturing, no
941 conversion is necessary.  However, if the system time zone is not set
942 correctly, the system’s UTC time might not be correctly set even if
943 the system clock appears to display correct local time.  When capturing,
944 Npcap has to convert the time to UTC before supplying it to Wireshark.
945 If the system’s time zone is not set correctly, that conversion will
946 not be done correctly.
948 Other capture file formats, such as the OOS-based Sniffer format and
949 older versions of the Microsoft Network Monitor and Network
950 Instruments/Viavi Observer formats, save the arrival time of packets as
951 local time values.
953 Internally to Wireshark, time stamps are represented in UTC. This means that
954 when reading capture files that save the arrival time of packets as local time
955 values, Wireshark must convert those local time values to UTC values.
957 Wireshark in turn will display the time stamps always in local time. The
958 displaying computer will convert them from UTC to local time and displays this
959 (local) time. For capture files saving the arrival time of packets as UTC
960 values, this means that the arrival time will be displayed as the local time in
961 your time zone, which might not be the same as the arrival time in the time zone
962 in which the packet was captured. For capture files saving the arrival time of
963 packets as local time values, the conversion to UTC will be done using your time
964 zone’s offset from UTC and DST rules, which means the conversion will not be
965 done correctly; the conversion back to local time for display might undo this
966 correctly, in which case the arrival time will be displayed as the arrival time
967 in which the packet was captured.
969 [#ChAdvTabTimezones]
971 .Time zone examples for UTC arrival times (without DST)
972 [options="header"]
973 |===
974 ||Los Angeles|New York|Madrid|London|Berlin|Tokyo
975 |_Capture File (UTC)_|10:00|10:00|10:00|10:00|10:00|10:00
976 |_Local Offset to UTC_|-8|-5|-1|0|+1|+9
977 |_Displayed Time (Local Time)_|02:00|05:00|09:00|10:00|11:00|19:00
978 |===
980 For example, let’s assume that someone in Los Angeles captured a packet with
981 Wireshark at exactly 2 o’clock local time and sends you this capture file. The
982 capture file’s time stamp will be represented in UTC as 10 o’clock. You are
983 located in Berlin and will see 11 o’clock on your Wireshark display.
985 Now you have a phone call, video conference or Internet meeting with that one to
986 talk about that capture file. As you are both looking at the displayed time on
987 your local computers, the one in Los Angeles still sees 2 o’clock but you in
988 Berlin will see 11 o’clock. The time displays are different as both Wireshark
989 displays will show the (different) local times at the same point in time.
991 __Conclusion__: You may not bother about the date/time of the time stamp you
992 currently look at unless you must make sure that the date/time is as expected.
993 So, if you get a capture file from a different time zone and/or DST, you’ll have
994 to find out the time zone/DST difference between the two local times and
995 “mentally adjust” the time stamps accordingly. In any case, make sure that
996 every computer in question has the correct time and time zone setting.
998 [#ChAdvReassemblySection]
1001 === Packet Reassembly
1003 ==== What Is It?
1005 Network protocols often need to transport large chunks of data which are
1006 complete in themselves, e.g., when transferring a file. The underlying protocol
1007 might not be able to handle that chunk size (e.g., limitation of the network
1008 packet size), or is stream-based like TCP, which doesn’t know data chunks at
1009 all.
1011 In that case the network protocol has to handle the chunk boundaries itself and
1012 (if required) spread the data over multiple packets. It obviously also needs a
1013 mechanism to determine the chunk boundaries on the receiving side.
1015 Wireshark calls this mechanism reassembly, although a specific protocol
1016 specification might use a different term for this (e.g., desegmentation,
1017 defragmentation, etc.).
1019 ==== How Wireshark Handles It
1021 For some of the network protocols Wireshark knows of, a mechanism is implemented
1022 to find, decode and display these chunks of data. Wireshark will try to find the
1023 corresponding packets of this chunk, and will show the combined data as
1024 additional tabs in the “Packet Bytes” pane (for information about this pane.
1025 See <<ChUsePacketBytesPaneSection>>).
1027 [#ChAdvWiresharkBytesPaneTabs]
1029 .The “Packet Bytes” pane with a reassembled tab
1030 image::images/ws-bytes-pane-tabs.png[{screenshot-attrs}]
1032 Reassembly might take place at several protocol layers, so it’s possible that
1033 multiple tabs in the “Packet Bytes” pane appear.
1035 [NOTE]
1036 ====
1037 You will find the reassembled data in the last packet of the chunk.
1038 ====
1040 For example, in a _HTTP_ GET response, the requested data (e.g., an HTML page) is
1041 returned. Wireshark will show the hex dump of the data in a new tab
1042 “Uncompressed entity body” in the “Packet Bytes” pane.
1044 Reassembly is enabled in the preferences by default but can be disabled in the
1045 preferences for the protocol in question. Enabling or disabling reassembly
1046 settings for a protocol typically requires two things:
1048 . The lower-level protocol (e.g., TCP) must support reassembly. Often this
1049   reassembly can be enabled or disabled via the protocol preferences.
1051 . The higher-level protocol (e.g., HTTP) must use the reassembly mechanism to
1052   reassemble fragmented protocol data. This too can often be enabled or disabled
1053   via the protocol preferences.
1055 The tooltip of the higher-level protocol setting will notify you if and which
1056 lower-level protocol setting also has to be considered.
1058 [#ChAdvReassemblyTcp]
1060 ==== TCP Reassembly
1062 Protocols such as HTTP or TLS are likely to span multiple TCP segments. The
1063 TCP protocol preference “Allow subdissector to reassemble TCP streams” (enabled
1064 by default) makes it possible for Wireshark to collect a contiguous sequence of
1065 TCP segments and hand them over to the higher-level protocol (for example, to
1066 reconstruct a full HTTP message). All but the final segment will be marked with
1067 “[TCP segment of a reassembled PDU]” in the packet list.
1069 Disable this preference to reduce memory and processing overhead if you are only
1070 interested in TCP sequence number analysis (<<ChAdvTCPAnalysis>>). Keep in mind,
1071 though, that higher-level protocols might be wrongly dissected. For example,
1072 HTTP messages could be shown as “Continuation” and TLS records could be shown as
1073 “Ignored Unknown Record”. Such results can also be observed if you start
1074 capturing while a TCP connection was already started or when TCP segments
1075 are lost or delivered out-of-order.
1077 To reassemble of out-of-order TCP segments, the TCP protocol preference
1078 “Reassemble out-of-order segments” (currently disabled by default) must be
1079 enabled in addition to the previous preference.
1080 If all packets are received in-order, this preference will not have any effect.
1081 Otherwise (if missing segments are encountered while sequentially processing a
1082 packet capture), it is assuming that the new and missing segments belong to the
1083 same PDU. Caveats:
1085 * Lost packets are assumed to be received out-of-order or retransmitted later.
1086   Applications usually retransmit segments until these are acknowledged, but if
1087   the packet capture drops packets, then Wireshark will not be able to
1088   reconstruct the TCP stream. In such cases, you can try to disable this
1089   preference and hopefully have a partial dissection instead of seeing just
1090   “[TCP segment of a reassembled PDU]” for every TCP segment.
1091 // See test/suite_decryption.py (suite_decryption.case_decrypt_80211)
1092 // which would break when enabling the preference.
1093 * When doing a capture in monitor mode (IEEE 802.11), packets are more likely to
1094   get lost due to signal reception issues. In that case it is recommended to
1095   disable the option.
1096 // See test/suite_dissection.py (case_dissect_tcp.check_tcp_out_of_order)
1097 * If the new and missing segments are in fact part of different PDUs,
1098   then processing is currently delayed until no more segments are missing, even
1099   if the begin of the missing segments completed a PDU. For example, assume six
1100   segments forming two PDUs `ABC` and `DEF`. When received as `ABECDF`, an
1101   application can start processing the first PDU after receiving `ABEC`.
1102   Wireshark however requires the missing segment `D` to be received as well.
1103   This issue will be addressed in the future.
1104 // See test/suite_dissection.py (case_dissect_tcp.test_tcp_out_of_order_twopass)
1105 * In the GUI and during a two-pass dissection (`tshark -2`), the previous
1106   scenario will display both PDUs in the packet with last segment (`F`) rather
1107   than displaying it in the first packet that has the final missing segment of a
1108   PDU. This issue will be addressed in the future.
1109 * When enabled, fields such as the SMB “Time from request” (`smb.time`) might be
1110   smaller if the request follows other out-of-order segments (this reflects
1111   application behavior). If the previous scenario however occurs, then the time
1112   of the request is based on the frame where all missing segments are received.
1114 Regardless of the setting of these two reassembly-related preferences, you can
1115 always use the “Follow TCP Stream” option (<<ChAdvFollowStreamSection>>) which
1116 displays segments in the expected order.
1118 [#ChAdvNameResolutionSection]
1120 === Name Resolution
1122 Name resolution tries to convert some of the numerical address values into a
1123 human readable format. There are two possible ways to do these conversions,
1124 depending on the resolution to be done: calling system/network services (like
1125 the gethostname() function) and/or resolving from Wireshark specific
1126 configuration files. For details about the configuration files Wireshark uses
1127 for name resolution and alike, see <<AppFiles>>.
1129 The name resolution feature can be enabled individually for the protocol layers
1130 listed in the following sections.
1132 ==== Name Resolution Drawbacks
1134 Name resolution can be invaluable while working with Wireshark and may even save
1135 you hours of work. Unfortunately, it also has its drawbacks.
1137 * _Name resolution can often fail._ The name to be resolved might simply be
1138   unknown by the name servers asked, or the servers are just not available and
1139   the name is also not found in Wireshark’s configuration files.
1141 * _Resolved names might not be available._
1142 Wireshark obtains name resolution information from a variety of sources, including DNS servers, the capture file itself (e.g., for a pcapng file), and the _hosts_ files on your system and in your <<ChAppFilesConfigurationSection,profile directory>>.
1143 The resolved names might not be available if you open the capture file later or on a different machine. As a result, each time you or someone else opens a particular capture file it may look slightly different due to changing environments.
1145 * _DNS may add additional packets to your capture file._
1146 You might run into the link:{wikipedia-main-url}Observer_effect_(information_technology)[observer effect] if the extra traffic from Wireshark’s DNS queries and responses affects the problem you're trying to troubleshoot or any subsequent analysis.
1148 The same sort of thing can happen when capturing over a remote connection, e.g., SSH or RDP.
1150 // XXX Are there any other such packets than DNS ones?
1152 * _Resolved DNS names are cached by Wireshark._ This is required for acceptable
1153   performance. However, if the name resolution information should change while
1154   Wireshark is running, Wireshark won’t notice a change in the name resolution
1155   information once it gets cached. If this information changes while Wireshark
1156   is running, e.g., a new DHCP lease takes effect, Wireshark won’t notice it.
1158 // XXX Is this true for all or only for DNS info?
1160 Name resolution in the packet list is done while the list is filled. If a name
1161 can be resolved after a packet is added to the list, its former entry won’t be
1162 changed. As the name resolution results are cached, you can use
1163 menu:View[Reload] to rebuild the packet list with the correctly resolved names.
1164 However, this isn’t possible while a capture is in progress.
1166 // XXX Add information about the address editor frame (View -> Name Resolution -> Edit Resolved Name)
1168 ==== Ethernet Name Resolution (MAC Layer)
1170 Try to resolve an Ethernet MAC address (e.g., 00:09:5b:01:02:03) to a human readable name.
1172 __ARP name resolution (system service)__: Wireshark will ask the operating
1173 system to convert an Ethernet address to the corresponding IP address (e.g.
1174 00:09:5b:01:02:03 → 192.168.0.1).
1176 __Ethernet codes (ethers file)__: If the ARP name resolution failed, Wireshark
1177 tries to convert the Ethernet address to a known device name, which has been
1178 assigned by the user using an _ethers_ file (e.g., 00:09:5b:01:02:03 →
1179 homerouter).
1181 __Ethernet manufacturer codes (manuf file)__: If neither ARP or ethers returns a
1182 result, Wireshark tries to convert the first 3 bytes of an ethernet address to
1183 an abbreviated manufacturer name, which has been assigned by the IEEE (e.g.
1184 00:09:5b:01:02:03 → Netgear_01:02:03).
1186 ==== IP Name Resolution (Network Layer)
1188 Try to resolve an IP address (e.g., 216.239.37.99) to a human readable name.
1190 __DNS name resolution (system/library service)__: Wireshark will use a name
1191 resolver to convert an IP address to the hostname associated with it
1192 (e.g., 216.239.37.99 -> www.1.google.com).
1194 Most applications use synchronously DNS name resolution.
1195 For example, your web browser must resolve the host name portion of a URL before it can connect to the server.
1196 Capture file analysis is different.
1197 A given file might have hundreds, thousands, or millions of IP addresses so for usability and performance reasons Wireshark uses asynchronous resolution.
1198 Both mechanisms convert IP addresses to human readable (domain) names and typically use different sources such as the system hosts file (__/etc/hosts__) and any configured DNS servers.
1200 Since Wireshark doesn’t wait for DNS responses, the host name for a given address might be missing from a given packet when you view it the first time but be present when you view it subsequent times.
1202 You can adjust name resolution behavior in the Name Resolution section in the <<ChCustPreferencesSection,Preferences Dialog>>.
1203 You can control resolution itself by adding a __hosts__ file to your <<ChAppFilesConfigurationSection,personal configuration directory>>.
1204 You can also edit your system __hosts__ file, but that isn’t generally recommended.
1206 ==== TCP/UDP Port Name Resolution (Transport Layer)
1208 Try to resolve a TCP/UDP port (e.g., 80) to a human readable name.
1210 __TCP/UDP port conversion (system service)__: Wireshark will ask the operating
1211 system to convert a TCP or UDP port to its well-known name (e.g., 80 -> http).
1213 ==== VLAN ID Resolution
1215 To get a descriptive name for a VLAN tag ID a vlans file can be used.
1217 ==== SS7 Point Code Resolution
1219 To get a node name for a SS7 point code a ss7pcs file can be used.
1221 // XXX - mention the role of the /etc/services file (but don’t forget the files and folders section)!
1223 [#ChAdvChecksums]
1225 === Checksums
1227 Several network protocols use checksums to ensure data integrity. Applying
1228 checksums as described here is also known as _redundancy checking_.
1231 .What are checksums for?
1232 ****
1233 Checksums are used to ensure the integrity of data portions for data
1234 transmission or storage. A checksum is basically a calculated summary of such a
1235 data portion.
1237 Network data transmissions often produce errors, such as toggled, missing or
1238 duplicated bits. As a result, the data received might not be identical to the
1239 data transmitted, which is obviously a bad thing.
1241 Because of these transmission errors, network protocols very often use checksums
1242 to detect such errors. The transmitter will calculate a checksum of the data and
1243 transmits the data together with the checksum. The receiver will calculate the
1244 checksum of the received data with the same algorithm as the transmitter. If the
1245 received and calculated checksums don’t match a transmission error has occurred.
1247 Some checksum algorithms are able to recover (simple) errors by calculating
1248 where the expected error must be and repairing it.
1250 If there are errors that cannot be recovered, the receiving side throws away the
1251 packet. Depending on the network protocol, this data loss is simply ignored or
1252 the sending side needs to detect this loss somehow and retransmits the required
1253 packet(s).
1255 Using a checksum drastically reduces the number of undetected transmission
1256 errors. However, the usual checksum algorithms cannot guarantee an error
1257 detection of 100%, so a very small number of transmission errors may remain
1258 undetected.
1260 There are several different kinds of checksum algorithms; an example of an often
1261 used checksum algorithm is CRC32. The checksum algorithm actually chosen for a
1262 specific network protocol will depend on the expected error rate of the network
1263 medium, the importance of error detection, the processor load to perform the
1264 calculation, the performance needed and many other things.
1266 Further information about checksums can be found at:
1267 {wikipedia-main-url}Checksum.
1268 ****
1270 ==== Wireshark Checksum Validation
1272 Wireshark will validate the checksums of many protocols, e.g., IP, TCP, UDP, etc.
1274 It will do the same calculation as a “normal receiver” would do, and shows the
1275 checksum fields in the packet details with a comment, e.g., [correct] or
1276 [invalid, must be 0x12345678].
1278 Checksum validation can be switched off for various protocols in the Wireshark
1279 protocol preferences, e.g., to (very slightly) increase performance.
1281 If the checksum validation is enabled and it detected an invalid checksum,
1282 features like packet reassembly won’t be processed. This is avoided as
1283 incorrect connection data could “confuse” the internal database.
1285 ==== Checksum Offloading
1287 The checksum calculation might be done by the network driver, protocol driver or
1288 even in hardware.
1290 For example: The Ethernet transmitting hardware calculates the Ethernet CRC32
1291 checksum and the receiving hardware validates this checksum. If the received
1292 checksum is wrong Wireshark won’t even see the packet, as the Ethernet hardware
1293 internally throws away the packet.
1295 Higher-level checksums are “traditionally” calculated by the protocol
1296 implementation and the completed packet is then handed over to the hardware.
1298 Recent network hardware can perform advanced features such as IP checksum
1299 calculation, also known as checksum offloading. The network driver won’t
1300 calculate the checksum itself but will simply hand over an empty (zero or
1301 garbage filled) checksum field to the hardware.
1303 [NOTE]
1304 ====
1305 Checksum offloading often causes confusion as network packets to be
1306 transmitted are given to Wireshark before they are handed over to the
1307 hardware. Wireshark gets these “empty” checksums and displays them as
1308 invalid, even though the packets will contain valid checksums when they
1309 transit the network.
1311 This only applies to packets that are locally generated by the capture
1312 point. Received packets will have traveled through network hardware
1313 and should have correct checksums.
1314 ====
1317 Checksum offloading can be confusing and having a lot of [invalid] messages on
1318 the screen can be quite annoying. As mentioned above, invalid checksums may lead
1319 to unreassembled packets, making the analysis of the packet data much harder.
1321 You can do two things to avoid this checksum offloading problem:
1323 * Turn off the checksum offloading in the network driver, if this option is available.
1325 * Turn off checksum validation of the specific protocol in the Wireshark preferences.
1326   Recent releases of Wireshark disable checksum validation by default due to the
1327   prevalence of offloading in modern hardware and operating systems.
1329 ==== Partial Checksums
1331 TCP and UDP checksums are calculated over both the payload and from selected
1332 elements from the IPv4 or IPv6 header, known as the pseudo header. Linux
1333 and Windows, when offloading checksums, will calculate the contribution from
1334 the pseudo header and place it in the checksum field. The driver then directs
1335 the hardware to calculate the checksum over the payload area, which will
1336 produce the correct result including the pseudo header's portion of the sum
1337 as a matter of mathematics.
1339 This precomputation speeds up the hardware checksum calculation later,
1340 allows the driver to direct the hardware to do checksums over encapsulated
1341 payloads (__Local Checksum Offload__), and allows applications to send
1342 the kernel large "superpacket" buffers that will be later divided by
1343 the hardware into multiple maximum size packets when sent on the network
1344 (__TCP Segmentation Offload (TSO)__ and __Generic Segmentation Offload (GSO)__).
1346 [NOTE]
1347 ====
1348 Wireshark 4.2.0 and later can calculate the partial checksum contribution
1349 from the pseudo header, and when validating TCP and UDP checksums will
1350 mark partial checksums as valid but partial. The packets with partial
1351 checksums will not be colored as Bad Checksums by the default coloring rules,
1352 and will still be used for reassembly. This eliminates spurious checksum
1353 errors seen on packets transmitted from the capturing host on those platforms
1354 that use partial checksums when offloading.
1355 ====
1357 // End of WSUG Chapter Advanced