🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #62657

Re: xBin and PARity files

#62657
From: Curt Welch
Date: Thu, 02 Jan 2003 03:23
142 lines
7795 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:
> [Curt Welch]:
> I'm not sure I've got this right.  I thought we'd split the file into
> segments of 100 article, and make PAR for each of these segments.  the
> size of the PAR information is the same as one article.  a PAR article
> would in addition include the correct hashes for the 100 articles it
> covers.  that's the 36 KB i mentioned.

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.

If you use the hash-tree system to "include the hash for each article",
then you can't include just one hash value, you have to include all the
hash values at the tops of the subtrees that cover each article.


       g
   e       f
 a   b   c   d
1 2 3 4 5 6 7 8

If the above 8 blocks were one article, then you only need to include value
g to specify the hash for the article.  But if blocks 3 to 7 were in one
artcile, you would have to include the hash values b, c, and 7 to specify
the "hash" for the article.  So you need 3 hash values to cover that 1 file
which is 1 out of 100 in the par block.

If each block above was a separte file in a 8 file par block, you can't
include just hash g because that is not enough to help you understand that
block 3 alone is valid or not.  If you want the power to validate each file
as it's recreated, you have to include a lot more hash values.

> >   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.
>
> where does this "5 hashes per segment" come from?

The terms segment might be confusing you.

If you have a 100 article par block (i.e. the par data covers 100 articles
all the same size as the par article), then each article in that block
would need mulitple hash values.  5 is an example for about how many are
needed for a each file.  So dependig on the size of the articles and how
many are protected by the par data, you may need 5 * 100 hash values
included in the each par article.

A file which spaned 31 hash blocks would need 5 or more hash values to
cover the data in that file (that's a 700KB file).

> >   > 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.
> >
> >   Adding the large set of hash data to the par file wouldn't save
> >   you any download time,
>
> right, quite the opposite (10%).

Well, I wasn't talking about the the added size, I was talking about how it
wouldn't help the download tool make better decidsions about which par
articles to download.  So you are forced to download all the same articles
with or without that data.

> >   and it wouldn't make it easier to figure out which par files were
> >   good vs bad.
>
> yes it would, by an order of 20 or more (the number of blocks in a
> part).  if you have five PAR files, and need three of them, you'll
> need to try a lot of combinations before finding out which two are
> fake.  there are ten possible picks (5!/2!3!), only one is correct.
> in most systems it will probably give a better speedup than 20, due to
> caching effects.

But how does the extra hash data help you search those 10 picks faster?

> a devious attacker may let the first block be correct, so the program
> may pick the wrong PAR files.  this doesn't really matter, the block
> is still valid, and the program just has to do a new search when it
> turns out block two is incorrect.
>
> >   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.
>
> it really depends on how paranoid we are.  if there are no attackers,
> the 10% increase in size of PAR files isn't worth it.

Well, I don't think I understand enough about what time the extra hash data
saves so it's hard to try to weigh it against the 10% increase.  Also, the
issue isn't just one of the 10% size increase (which I see as minor), it's
also an issue of added complexity of more meda data in each par file ("what
is that for and how is my code going to use that?").

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.

> >   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?
>
> 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?

> >   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"?
>
> yeah, users generally shouldn't deal with this, the client should do
> all the work behind the scenes.

yeah.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20030101222332.694$bV@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: <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>

Show Full Headers
Complete Article Headers
Message-ID: <20030101222332.694$bV@newsreader.com>
Subject: Re: xBin and PARity files
Date: Thu, 02 Jan 2003 03:23:32 +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>
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 pmlEl8pV.ky5RvzM@=jGu6kbAo5MiHhb6VItDrzSz+_ff2J_t
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: 141