Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I run the command

tshark -i 3 -c 100 -V less 1514 src 192.168.10.57 and dst 192.168.10.60 and tcp

The output is:

Transmission Control Protocol, Src Port: commplex-link (5001), Dst Port: 63077 (63077), Seq: 1, Ack: 1, Len: 0

Source port: commplex-link (5001)
Destination port: 63077 (63077)
[Stream index: 0]
Sequence number: 1    (relative sequence number)
Acknowledgement number: 1    (relative ack number)
Header length: 20 bytes
Flags: 0x10 (ACK)
    0... .... = Congestion Window Reduced (CWR): Not set
    .0.. .... = ECN-Echo: Not set
    ..0. .... = Urgent: Not set
    ...1 .... = Acknowledgement: Set
    .... 0... = Push: Not set
    .... .0.. = Reset: Not set
    .... ..0. = Syn: Not set
    .... ...0 = Fin: Not set
Window size: 40960
**Checksum: 0x95e0 [validation disabled]**
    [Good Checksum: False]
    [Bad Checksum: False]

How can I have the TCP checksum field calculated? What command can I use to make this happen?

share|improve this question

migrated from stackoverflow.com Dec 29 '12 at 8:25

This question came from our site for professional and enthusiast programmers.

1 Answer 1

tshark -o tcp.check_checksum:TRUE ... will do the trick.

Notes:

  1. tshark uses the current prefs values from the current profile unless told otherwise. Default values are used if prefs have never been changed & saved (in Wireshark).

  2. tshark -G currentprefs lists the current prefs (descriptive text, pref name & value)

    tshark -G defaultprefs lists the default prefs (ditto).

    so:

    tshark -G currentprefs | egrep -B2 "^#?tcp\." will list all the tcp pref names and their current values (along with some descriptive text). Only those prefs not preceeded by # have values other than the default.

If you want to ensure that tshark uses default prefs with only the prefs changes you specify:

tshark -C Default -o tcp.check_checksum:TRUE ...

See tshark -h and the tshark man page for info on the tshark options.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.