GithubHelp home page GithubHelp logo

bttools's Introduction

  • I am moving to Sourcehut.
  • I might leave my older projects, and even mirror some newer ones, here. That said, Sourcehut is going to be my main home for source code.

bttools's People

Contributors

admirito avatar elektito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bttools's Issues

Timeout flows properly.

The flows are not being timed out at the moment at all. If a flow remains open for a relatively long period of time without any communication in it, it must be removed from the flow table.

Better logging in btparser.

In order to make btparser log machine-parsable, make the following changes to it:

  • When a new file is going to be parsed (whether with the -d or -f option) its path should be logged:

    [NEW FILE] /home/foobar/stream-0-192.168.1.100-33465-192-168.1.200-54654

  • When an error or warning is logged, it should be clearly marked:

    [ERROR] Invalid BitTorrent stream.

Write a log analyzer for the tracers.

Write a log analyzer for UtpTracer and TcpTracer. The analyzer should report the following:

  • What error messages were encountered? How many times each?
  • How much traffic was thrown away in total?
  • How much traffic is pending at the end?

Also, for each flow, the following should be reported:

  • How many packets were thrown away for this particular flow in total.
  • How many packets were pending for that flow when it was being closed or at the end.

Write a log analyzer for btparser.

For each file btparser parses, the log analyzer should output:

  • How much "piece data" was there (in bytes)?
  • How much header data was there (in bytes)?
  • Was there an error in the file (for example a very large block length)?

Also at the end the following should be output:

  • What infohashes were encountered?
  • What pieces for each infohash were encountered (even partially).
  • How many blocks for each piece were observed? How many unique blocks.

There are way too many "Invalid connid" errors .

There are too many "Invalid connid" errors. An inspection shows that sometimes a connection is shortly established and half-closed in a "SYN=>STATE=>FIN" sequence. When this happens, an entry is kept in the flow table for the flow and anything afterwards is ignored, even though a new connection can be established with a new connid.

Making connid a part of the flow tuple-id can fix this.

Implement command-line options for btparser.

btparser.py should accept the following command line arguments:

  • --torrent or -t: a torrent file from which torrent information is read and associated with its infohash. Can be specified multiple times.
  • --file or -f: a file containing a single BitTorrent stream to parse.
  • --directory or -d: all the files in the given directory are processed.

Either -d or -f must be specified.

Better formatting for tracer logs.

Make UtpTracer and TcpTracer to format their logs like this: "[packet number][flow] message". For example when a new flow created, something like this should be logged:

[1681][192.168.1.100:53456 => 192.168.1.200:38765] New flow.

IP fragmentation is not handled.

Some of the input files have been corrupt for no apparent reason. Inspection showed that this is due to IP packet fragmentation. Implement an IPv4 defragmenter in order to fix this.

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.