[BitTorrent] Re: bencoding 0:

Elliott Mitchell ehem at m5p.com
Sun Nov 21 02:02:02 EST 2004

>From: skybuckflying <skybuck2000 at hotmail.com>
> --- In BitTorrent at yahoogroups.com, "Olaf van der Spek" <OvdSpek at L...> 
> wrote:
> > > Excellent :)
> > > 
> > > So that means the minimum size of a string is 2 characters.
> > > 
> > > I do wonder a bit about the "character set" being used...
> > > 
> > > It's probably just ansi... and unicode is compatible with that... 
> lol.
> > 
> > ANSI or ASCII?
> Isn't ASCII the same as the lower 128 ANSI characters ?

Not even close. ASCII officially defines characters associated with the
lowest 128 values of a byte (bytes with the meta bit clear). ANSI is a
set of very commonly used terminal escape sequences. Used for changing
colors, and setting/getting the cursor position (there are additional
ones, but those are of most import). All ANSI sequences begin with
<ESC>[. There is though ASCII art, and ANSI art. ANSI art is a lot more
spectacular and sometimes includes animation.

> > Why is the min size so important to you?
> Well just so parsing routines can exit when a string is less than the 
> minimum :)

Any string of digits is a valid string length (no one generates strings
of length 0000, but it is valid by the spec).

> Anyway I'll use this post to bring up a possible issue for the future.
> My bencoding parser is now pretty robust... though I still have to 
> implement dictionaries.

That doesn't sound very robust.

> I think most if not all communication between trackers and clients, 
> and clients <-> clients is bencoded right ?

No. torrent files, and tracker responses only. Client to tracker is
standard URLs. Client to client is the binary protocol specified by the
torrent spec.

> So that means all this "bencoding/bdecoding" is going to require a 
> lot of parsing etc.
> I think this could become an issue for "slow" PC with "fast" 
> connections in the future, if it's not already an issue :)
> My estimate would be that it becomes an issue for say a PIII 450 mhz 
> and 1 MByte/sec connection =D then maybe it would be stuck at say 500 
> to 700 KByte/sec.
> Ofcourse these slow CPU's arent'y sold anymore and maybe most people 
> have fast cpu's so maybe it won't be an issue...:)

Well, I shot one basis down above. Even though hexidecimal would be
faster, there isn't too much information so it wouldn't be that

There are many systems with 200MHz processors being manufactured and sold
today. The examples that come to mind are the LinkSys WRT54G* machines
(200MHz MIPS), and PDAs (200-300MHz ARM). Though to my knowledge they
generally aren't used for running BT, they are perfectly valid machines
to run BT clients.

What do you need? If you're running into the issue that the mainline
client is Python, then there are multiple implementations. libbt
http://libbt.sourceforge.net/ is a C library client, libtorrent
http://libtorrent.sourceforge.net/ is a C++ library client.

(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \   (    |         EHeM at gremlin.m5p.com PGP 8881EF59         |    )   /
  \_  \   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
    \___\_|_/82 04 A1 3C C7 B1 37 2A*E3 6E 84 DA 97 4C 40 E6\_|_/___/

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!

Yahoo! Groups Links

<*> To visit your group on the web, go to:

<*> To unsubscribe from this group, send an email to:
    BitTorrent-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

More information about the BitTorrent mailing list