🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #62470

Re: xBin (Power-Post 2003 - requesting input from authorities..)

#62470
From: Curt Welch
Date: Sat, 28 Dec 2002 07:33
156 lines
9145 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:
> [Rene]:
> >
> >   But not anymore, is it?
>
> no.  thanks.
>
> >   Level is not the important variable. Worst Case is. And I've now
> >   provided the algorithm / the java programm to calculate those. A
> >   2GB (2*10^9, not 2^..) file needs 444445 blocks if a block is 4500
> >   bytes. That creates a worst case of 36 hashes (not counting the
> >   root) 36*27 Bytes = 972 Bytes.  Damn close to the 1000 Byte-header
> >   limit. And you haven't said "X-bin-Signature" then...
>
> and you need a space between each hash as well...

Right, so with the full hash + the X-Bin-Signature" you end up with
16+37*28 or 1052 and you still haven't added the CR LF.  And that for a 2,
000,000,000 byte file and not a 2GB file.

> >   If a block were 4 times as large (18000 Bytes), then a 2GB file
> >   would span 111112 blocks, the worst case were 32, which is 864
> >   Bytes for hashes alone.

4500 is 100 uuencode lines.  4 times would make multipart uuencode posts a
multiple of 400 lines which is a bit odd.  5 times as large forcing
uuencode posts to be a multiple of 500 lines would be better.  That's a
block size of 22500 bytes.

How long would the total worse case header be for a hash block size of
22500 butes with a 2GB file when you include the "X-Bin-Signature:" (16
bytes) plus the total file hash and a space (28 bytes), and 28 bytes for
each tree-hash required?

That's going to be less than the 32 above, so that puts it under 940 bytes
total by my calculation.  It would be good if the header was less than 997
bytes for a 2GB file. (997 an INN magic number and 2GB a 32bit signed
pointer file size magic number).

I think it might also leave enough bytes to allow the header to be folded
at a resonable line legnth like 75 which as well and still keep the header
under the 997 number.

Knowing that the standard caused no header length problems for files up to
2GB in size would be nice.  Large files could be posted and would probably
work today as long as the header was folded so each line was under the 997
number.

But, unlike References: this is a header that we can not risk allowing it
to be corrupted. If it's corrupted on 50 posts out of a 2000 part set which
hits the worse case, and gets rejected all over the place as being invalid,
we would have a nasty little problem.

> I think 4500 is too small, 64 KiB would be a good choice, or perhaps
> 32 KiB.  no one should be posting multipart binaries with full parts
> smaller than 256 KiB, anyway.  to make articles sizes as similar as
> possible, some parts will be smaller, of course:
>
>  257 KiB -> 3+2 blocks (not optimal, since the actual size will be
>                         192+65)
>  513 KiB -> 3+3+3 blocks (actual size 192+192+129)
> 4097 KiB -> 4+4+3+3+3 blocks (actual size 256+256+192+192+129)

   577 Kib -> 4+3+3 blocks (actual size 256+192+129)

Last file is half the size of the first.  I don't like the looks of that.

And if you post in uuencode:

   577 Kib -> 4+3+3 blocks (actual size 358+268+180)

When you spread the blocks evenly, the last file will in the worst case be
one block less than the rest, be the last block in the last file can be as
small as 1 byte, so the worse cast is a size difference from the first post
the last of 2X the block size.  And if you post in uuencode, add 40% to
that.  A 4500 byte hash block means uuencoded posts can be as much as 12K
different in size.

A 64K hash block size means the article size difference can be as much as
180K different.  On average, you will expect a difference of 1.5 blocks
which would be 130KB for uuencoded posts (or 96K for yEnc).  That strikes
me as too large a difference.

I do like the effect of forcing the minimal multipart post size higher, but
I think leveling article sizes is more important in terms of helping usenet
run smoother.

For 22500 byte blocks (500 uu lines), the max part size difference would be
61K.  Or, for a 2000 line per post uuencoded file (126K article), the last
part could be as small as 1001 lines.  I don't really like seeing that much
difference in the article sizes of a multipart post.

Large hash blocks reduce the number of hash values, but the effect is small
because of the logrithmic nature of the number of hash values required.
You save what 4 out of 36 by going with a block size that is 4 times as
large.  But if it allows us to keep the header under a total size of 1000
bytes for a 2B file, that might be a valid justification for going larger
than 4500.

> (I think a guideline regarding this should be part of the xBin
> documentation.)

I agree.  And if we get into reed-solomon support (PAR files) as a built in
feature, then the "standard" way to split articles could be a very
important part of it all.

But I realized we have another big problem with the idea of PAR files as
part of this standard.  I see no way to verify them.  The idea of this
standard is to prevent people from posting fakes, yet I see no way to stop
them from posting a fake PAR file.

I see no way to prevent fake PARs from being posted or to spot them as fake
in-transit. If you download them and use them, then you can recreate a
missing segement, and once you have that, you could try to verify the
segment by itself if you had other partial hash values from other "known
good" segements.  But if you didn't already have enough "known good" hash
values from other articles, then all you could do is wait till you have all
the segments for the file and then recalculate the tree hash for the entire
file.  But if that failed to match, and you had a 2000 part post with 50
PAR files, the automatic download tool would have no easy way to find the
fakes other than download more par files (if it can find them), and then
use differetnt combinations of par files to recreate a "known good" segment
to see which combination of the 50 par files produced a vaild copy of the
known good one.  Of couse, if none did, then you would have to contine
downloading more PAR files an continue an potentially huge serach to weed
out the fakes from the real ones.

The use of PAR files could just be "unsafe" which is no worse than it is
now. But anyone wanting to cause trouble could then attack with bogus PAR
files which I think could lead to no one useing them which might mean it
would be stupid to spend the time to add support for them withing the xBin
system.  They could still be used as now external to the system, but they
just wouldn't be safe from attack.

> >   A 20GB file would exceed 1000 Bytes with a worstcase of 39 though.
>
> likewise, there should be a guideline telling posting tools to try to
> use power-of-two segment sizes (in blocks) to reduce the size of the
> hash signature.  (when expressed in binary, the segment size should
> have as many zeroes to the right as possible -- 12 (1100) is better
> than 10 (1010).  8 is even better, but the smaller segment size
> requires more parts, so 12 (ie., rounding up) is probably better.)

Yes, that would be wise as well.

If this gets to the point of people using it, what I would like to do is
create test data for developes which check all these worse case issues,
and, create a tool which examines every post to a test.xbin group and posts
an automatic follow-up text message telling the poster if the article was
valid and followed all required and recomended guidelines.  It would also
test for valid use of things like yEnc as well.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20021228023313.941$tN@newsreader.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed1.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <cdda0v4h6t52ov7abf1j0qkpo843itf4se@4ax.com> <cfka0vsbjdlbdmtv2gg8qnehok033qh5f1@4ax.com> <20021223041127.986$6M_-_@newsreader.com> <1rfzsoaacf.fsf@vingodur.ifi.uio.no> <20021223150103.132$Bb@newsreader.com> <1rd6ns9y06.fsf@tolf.ifi.uio.no> <20021223181329.108$LI@newsreader.com> <1rfzsjz87r.fsf@sjau.ifi.uio.no> <20021227144125.156$Nm@newsreader.com> <1rsmwjxgk5.fsf@sjau.ifi.uio.no>

Show Full Headers
Complete Article Headers
Message-ID: <20021228023313.941$tN@newsreader.com>
Subject: Re: xBin (Power-Post 2003 - requesting input from authorities..)
Date: Sat, 28 Dec 2002 07:33:13 +0000
From: curt@kcwc.com (Curt Welch)
References: <cdda0v4h6t52ov7abf1j0qkpo843itf4se@4ax.com> <cfka0vsbjdlbdmtv2gg8qnehok033qh5f1@4ax.com> <20021223041127.986$6M_-_@newsreader.com> <1rfzsoaacf.fsf@vingodur.ifi.uio.no> <20021223150103.132$Bb@newsreader.com> <1rd6ns9y06.fsf@tolf.ifi.uio.no> <20021223181329.108$LI@newsreader.com> <1rfzsjz87r.fsf@sjau.ifi.uio.no> <20021227144125.156$Nm@newsreader.com> <1rsmwjxgk5.fsf@sjau.ifi.uio.no>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed1.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com HJ0YZFdOJJI0ZVCF3XFYy.pa_zgVwaLWsTjEuxEK.hsf=AYw
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 155