🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #62687

Re: xBin and PARity files

#62687
From: Curt Welch
Date: Thu, 02 Jan 2003 20:26
103 lines
5895 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:
> [Curt Welch]:
> >
> >   Right, if a par file covers 100 articles, and we try to include
> >   "the correct hash" for each individual aritcle, there are two
> >   different ways to do that.  I'm not sure which you are talking
> >   about.
>
> I suggest to include all the _leaves_, the hash of every xBin block
> covered.  no tree information at all.

Ok, I understand now.  That means you are including even more more hashs
than I was talking about.  So instead of 5 hashes to cover 31 blocks, you
would need 31 hash values.

But like you say, you can then reject a bad combination of PAR files after
reconstructing any one hash hash block.

> >   But how does the extra hash data help you search those 10 picks
> >   faster?
>
> first, you verify that the leaf hashes included in the PAR files fit
> into your tree constructed from the normal articles.  then you
> reconstruct the first missing block.  compute its hash, see if it
> matches.  if it doesn't, one (or more) of the PAR files was bogus, try
> a different pick.
>
> the win is that you only have to process _one_ block, rather than all
> the twenty blocks in the file, before you can smell a rat.

Ok, I need to uderstand more about the PAR algorithm before I can measure
the real value of that.

You have to scan the entire 100 file PAR set to reconstruct data, but it
might be fine (even resonable) to do it one hash block at a time.  So if
each article was 30 hash blocks, and the PAR data spanned 100 articles, you
could scan the data reading only the first hash block of each article to
calcuate the first hash blocks of each missing file. Being able to reject
the PAR set as invalid after one pass like this would reduce the
computation but almost 1/30th.

But, for typical file sizes and typical PAR file spans, how much time is
that saving?  If scaning and rebuilding the missing files of a typical PAR
set was only a 1 second processes to start with, and repeated scans were
even faster because of data blocks cached, then you might not be saving
that much.

Or, if it's better to not skip blocks and scan the entire PAR set
sequentially, then being able to reject after the first hash block might
not save enought to be justified.

I need to understand this better.

> (if two parts are missing, I guess you'll have to reconstruct two
> blocks, but on the other hand you'd have to do forty blocks before
> being able to verify the data otherwise, so the ratio is the same.)

Right.

> >   On the time issue, for example, as long as you have to scan all
> >   the other articles in the PAR set as you reconstruct a missing
> >   article, is it possible and resonaoble to reconstruct all missing
> >   articles at the same time?  I suspect that the answer is yes.
> >   That not only can you, but that it is by far the most resonable
> >   way to do it, because once you have all the data you need to do
> >   the math to find the answer for one file, you have the answer for
> >   the other missing files at the same time.  So being able to spot
> >   that the first reconstructed file by itself is bogus saves very
> >   little time since after only a little more work, you have all the
> >   parts and can easially compute and verify the file hash.
>
> that's the way I imagine it must work as well.
>
> >   > I don't think uudecode is clever enough to create the directory
> >   > if needed.
> >
> >   But will it cause chaos and core dumps, or will some be smart
> >   enought to just use the part of the file name after the / or what?
>
> on Unix, you'll get a ENOENT from open since the directory doesn't
> exist.
>
>   $ head -2 testinf
>   begin 644 uggabugga/foo.avi
>   M(R`N8F%S:')C"@HC(%5S97(@<W!E8VEF:6,@86QI87-E<R!A;F0@9G5N8W1I
>   $ uudecode testinf
>   uudecode: uggabugga/foo.avi: testinf: No such file or directory

Yeah, that's no doubt common. I don't even remeber what my web interface
code does.  But it might look for / and \ and ignore everything in front of
it to deal with the problem of "begin C:\mycoduments\file.doc"

It's probably best to not think about trying to put directory names in the
begin line.  But then again, I suspect there's very little purpose in
trying to extract xBin PAR data with any tool except one designed to deal
with xBin PAR data, so maybe it's ok to do anything we want there???

We need to figure out other things first however....

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20030102152631.435$cR@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!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> <20021231140408.995$iu@newsreader.com> <1rlm24a74r.fsf@thrir.ifi.uio.no> <20030101222332.694$bV@newsreader.com> <1rptrflqrl.fsf@ellifu.ifi.uio.no>

Show Full Headers
Complete Article Headers
Message-ID: <20030102152631.435$cR@newsreader.com>
Subject: Re: xBin and PARity files
Date: Thu, 02 Jan 2003 20:26:31 +0000
From: curt@kcwc.com (Curt Welch)
References: <20021230133312.202$K5@newsreader.com> <20021230171837.399$Im@newsreader.com> <1r7kdr2id0.fsf@vingodur.ifi.uio.no> <20021231140408.995$iu@newsreader.com> <1rlm24a74r.fsf@thrir.ifi.uio.no> <20030101222332.694$bV@newsreader.com> <1rptrflqrl.fsf@ellifu.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!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 ZVrkDJ5S,wA3lB8jGryp2qDdkCJ=4..PtJ6ZXZ8K=B-W@2MK
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: 102