🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #62615

Re: xBin and PARity files

#62615
From: Curt Welch
Date: Tue, 31 Dec 2002 19:04
98 lines
5786 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:
> [Curt Welch]:
> >
> >   If we include an X-Bin-Signature for each par file which is the
> >   same signature you would put on an article spanning the entire
> >   par-set, you would then have the hash values you need to veryify
> >   the entire par-set once it was re-constructed (i.e. the 100
> >   article set).
>
> how about including the hashes of the correct blocks instead?  all the
> leaves, not the tree.  these can be verified against the hash tree in
> the real parts.  for a segment of 100 parts of 18 blocks, the hashes
> use 36 kB (+N% for encoding), which seems reasonable to me.  (if you
> want to, you can require segments to start on even offsets, and
> include the hashes from the level above the leaves, cutting the size
> in half.)

I thought about that, but it's a lot of data if the par file covers a lot
of segments.  It won't fit in the headers.  But you could put in the
article body. The problem is that you need the has not for the entire
range, but for each par segment.  Typical article size is in the 400KB
range which means, or up to say 20 or hash blocks (of the 22500 size),
which means worse case hash values of around 5 per segment.  You would need
those for every segemnt, so if you covered a 10MB segment of a file with
the PAR data, you are talking 25 segments and 125 hash values which is 3K
or 4K worth of metadata.  That would work for a 400K par post, but like I
said, not in the headers.

Ah, but it would be of some potential use to just include a different
single hash value of each par segment.  That wouldn't allow you to prove
the generated segment was part of the xBin file, it would help you spot
problems quicker, and then you only need one hash value per segment instead
of up to 5.  I suspect however that even that isn't worth it however.

> it really depends on how PAR works -- can you do block by block, or
> PAR file by PAR file?  if the former, you can detect bogus PAR files
> much earlier if you're told the hash value of the block.

You create blocks one at a time, but only after you have all the PAR files
needed.  Each different par file is generted using a different reed-solomon
equation which is a linear equation (ax + by + cz = p) which calcuates each
byte in the par file from the matching bytes from the 3 data blocks.

If you have 2 par files, and 2 data blocks missing, you have this:

  a1x + b2y + ccz = p1
  a2x + b2y + c2z = p2

Where a1, b2, a2, etc are reed-solomon defined constants. and x is the byte
from the first data file, y the seconed, z the third, and p1 and p2 are
bytes from the par files.

So if you have two par files, you have two equations like above, so you can
have up to two data values missing, and can still solve the equation for
the unknown variables.

If you have 2 par files, and 3 missing blocks, you can't solve anything.
So you can't fill in any holes until you have enough par files to fill them
all in.

So as long as you have to wait to fill them all in to find your answer,
then why not go ahead and generate all of them and use the much smaller
"hash values for the rest of the file", to figure out if this set of par
files is valid or not.

Adding the large set of hash data to the par file wouldn't save you any
download time, and it wouldn't make it easier to figure out which par files
were good vs bad.  It would only save computation time because instead of
computing and generating your N missing articles, you would know if they
were good after the first was generated.  I suspect the simplicity of
leaving the hash data out is more important than saving some number
crunching time.

> I think the root hash of the file should be in that filename as well.
> we may have to consider filelength limits...

>   OFFSET-SEQ-SPAN-ROOTHASH.XBP
>   xxxxx-x-xx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.XBP

The potential file name length issues is what worries me.

I was suggesting putting the roothash in the directory name as:

 XB-ROOTHASH/OFFSET-SEQ-SPAN.XBP

 XB-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxx-x-xx.XBP

to keep the files names a bit more managable.  Maybe you can even get away
with using a name like that in a begin or =begin line?

Maybe the way to do it is use a single file name in the actual article
"begin" or "=ybegin" line like you suggest, but just assume it will never
be created like that for the "disk format standard"?

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20021231140408.995$iu@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!cyclone.bc.net!news-hog.berkeley.edu!ucberkeley!newshub.sdsu.edu!news-xfer.cox.net!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <20021230133312.202$K5@newsreader.com> <20021230171837.399$Im@newsreader.com> <1r7kdr2id0.fsf@vingodur.ifi.uio.no>

Show Full Headers
Complete Article Headers
Message-ID: <20021231140408.995$iu@newsreader.com>
Subject: Re: xBin and PARity files
Date: Tue, 31 Dec 2002 19:04:08 +0000
From: curt@kcwc.com (Curt Welch)
References: <20021230133312.202$K5@newsreader.com> <20021230171837.399$Im@newsreader.com> <1r7kdr2id0.fsf@vingodur.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!cyclone.bc.net!news-hog.berkeley.edu!ucberkeley!newshub.sdsu.edu!news-xfer.cox.net!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com dMqrLCKNpJ@_h0yeKk0EREQ2z.p2i2qMNVV@5g_mroGAng-4
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: 97