Giter Club home page Giter Club logo

pcapdecoder's Introduction

PCAPDecoder

PCAP Timestamp Decoder enables users to decode the timestamps applied by the Arista 7150 series switches.

INSTALLATION

Requirements:

In order to install PCAP Timestamp Decoder, copy 'pcaptd' to your filesystem.

Then define the mapping between the device id (in the key frames) and the VLANs corresponding to the packets timestamped through that device in the highlighted section below (at the beginning of the script).

Once the mapping is configured, the PCAP Timestamp Decoder can then be started using:

(bash:root)# <path-to-script>/pcaptd [<options>] <input_pcap>

CONFIGURATION

In order to show UTC decode details, use the '--utc-details' option. By default, stats are sent to stdout. In order to print them to a file, use the '--write-details-to-file' option (this is recommended for large input pcap files).

The following options can be used in order to control the details generated by the script:

  -d, --delta           show delta between consecutive packets
  -f, --fcs             input pcap includes FCS
  -p, --pcap-timestamps show pcap timestamps
  -r, --recover-utc     show UTC time
  -s, --src-ip          show source IP
  -t, --ticks           show hw timestamps as ticks

The 'Notes' column can have one of the following values:
 - R:       rollover
 - KEY:     key frame

The script can create a new pcap file, identical with the input one, except that the timestamp in the pcap is replaced by the decoded UTC value. In order to enable this behaviour please use the '--output-file' option. Note that the entries which cannot be decoded will show up with a timestamp of 0 in the output file. Moreover, note that the timestamp format of the new pcap file is using nanosecond precision; this means that older versions of Whireshark (earlier than 1.0.5 ) might not be able to decode it. For more on this, see:

http://wiki.wireshark.org/Development/LibpcapFileFormat

COMPATIBILITY

Version 4.0 has been developed and tested against Python 2.7 on MacOS, but should work on any other operating system supporting Python 2.6 or later. Please reach out to [email protected] for assistance if needed.

LIMITATIONS

The tool tries to detect a counter rollover (by checking if a subsequent timestamp has a lower tick value than it predecessor). However, this mechanism does not uncover periods where the inter-timestamp delta is > 6.15s. This can result in undetected rollovers, if:

6.15s < delta < (2 * 6.15 - previous timestamp)

Multiple rollovers cannot be tracked and may go undetected.

When the '--output-file' option is used, the resulting file's timestamp accuracy will be microseconds. This is because libpcap does not support nanosecond precision. If nanosecond precision is desired, use the '--utc-details' option.

One or two keyframes in advance are required for decoding UTC in a packet. If they are not available, then decoding the timestamp in packets might not be possible.

The decoder assumes that the timestamp is located in the last four bytes of the frame. If the input file includes the Ethernet FCS (typically stripped by the NIC driver) this will result in parsing the wrong part of the frame as the timestamp. Use the --fcs option to ignore the last four bytes and consider the previous bytes as timestamp.

LICENSE

BSD-3, See LICENSE file

pcapdecoder's People

Contributors

advornic avatar dermoth avatar privateip avatar archjeb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.