🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #64120

Re: xBin and PARity files

#64120
From: Chris
Date: Sat, 22 Feb 2003 17:42
161 lines
9968 bytes
On Fri, 21 Feb 2003 23:30:59 +0000, Curt Welch wrote:
> From the pdf, it seems that you need to do that special type of math on
> those 16 bit words, and it seems like the math is best done using lookup
> tables.  And I think that means for 16 bit words, you need two lookup
> tables which have 65536 entries with each entry being 16 bits.  So you
> need 256KB of lookup tables in your code to do that math.  That seems
> workable, but it is a lot of data and limits the size of machine you can
> run the algorithm on.  Though that may not be relevent. (and I may have
> my facts wrong about the size of the look-up tables needed).

True, for the 16-bit version you need 256KB of lookup tables.  You do need
lookup tables for 8-bit too, but that's only 512 bytes.

> However, what I suspect becomes more important is the amount of CPU and
> DISK overhead comes into play when you use RS data which spans thousands
> of virtual segements.
> 
> If I download a 1,000 part post (over a period of a week maybe) and I'm
> missing 1 part, then it is of course neat that someone could post a
> single PAR article to help anyone which lost any single post.
> 
> But, once I get that par article, the RS code will be forced to scan all
> 999 parts of the file and do the math, on all that data.  If the PAR
> files only covered sets of 100 articles each, then the people posting
> the PAR data will be forced to post more PAR articles to cover the
> entire post, but everyone missing a single article will still only have
> to download a single PAR file to fix it.  And, the compution work will
> only have to scan, and do math, on 100 articles instead of 999 articles.
>
> As files get really huge (and over time, they are only going to get
> worse), this might become very significant.  But, how much of a factor
> is this? How hard (CPU and disk-IO wise) is it to do the math to use the
> PAR data?

The number of words read required to recover missing articles is equal to
 nArticlesSpanned * articleSize.  The number of computations done is equal
 to nArticlesSpanned * articleSize
(once you have the matrices set up...you have to invert a square matrix of
size nArticlesSpanned).  The 16-bit math is no more expensive than the
8-bit math (it's just all lookups in the tables). So it's a linear
increase in processor time and disk accesses as you span more articles.

> The other issue is that we have no way of knowing if a par file is fake
> just by looking at the file (like we do with all the real data segments
> with xBin).  This means someone can attempt to abuse the system and
> cause problems by posting fake PAR data.  The only way to veryify the
> PAR data is to use it to generate real data, and then check the real
> data to see if it's valid.

Yeah, I've been thinking about this...You do need to use the par data to
generate real data and then validate it.  A simple hash of the data
included in the headers would be useful to detect corrupt articles, but
won't protect against attack.

> However, if i have a 10,000 part post, and I'm missing 200 parts, then,
> with PAR files spanning the entire post, I won't be able to generate any
> real data until I've downloaded 200 PAR files.  Then, when I do all the
> math across my 9,800 valid parts and 200 unknown par parts, and find
> that the real data it generators is  bogus, this only tells me that at
> least one of those 200 PAR files is a fake.  I have no way of knowing
> which of those 200 par files is a fake without simply playing an
> computationaly huge game of mix-and match.

That's an aspect I hadn't thought about...That could be a really nasty
problem.  Heh, what about doing some cryptography in here too?  We can
validate articles, so include a public key in the article headers.  Sign
the par data with the corresponding private key.  Everybody writing an
xBin client will love us!

> I think, because of that problem, we will be forced to use PAR data
> which spans far fewer segments just to prevent abuse.  And if, in
> practice we never need to span more than 100 posts, and seldom span more
> than 20, then what's the point of using a 16 RS word size instead of 8?

None.

> And, no matter what word size you use, it will never be large enough to
> span the entire post.  File sizes will continue to increase over time,
> and the number of articles the file is split into will also continue to
> increase, so any word size you pick will one day reach it's limits.

Assuming you want to have the par blocks line up with the xbin blocks
(22500 bytes), 16-bit par data can cover just over one gig. (22500 *
65534)

> So, is there a justifiable reason to allow the RS word size to be
> specified in the data and force the tools to be smart enough to deal
> with different word sizes?  Or do we pick one size?  And if we do that,
> is there a good reason to go with 16 bits instead of 8?

No, we should pick one size...But this brings up something else I've been
thinking about.  There's been a lot of discussion about various
constants...22500 block size, 4500 block size, maximum article size, RS
word size, etc.  What about including some kind of version number in the
id?  Like ~~XB0~ would be the prototype version and would have various
constants defined as part of that version.

>> Why couldn't xBin handle both systems (consecutive par segments vs.
>> spanning entire file)?
> 
> As currently proposed, it can of course span the entire file and be
> consecutive if the number of parts in the file is small enough (for
> whatever word size is used for the RS algorithm).
> 
> We could add a little more information into the Message-Id to also allow
> the spanned data to be non-consecutive.  (every 10th block) But I
> question the value of that.  It seems to add nothing useful and only
> adds more complexity the algorithms will have to deal with to figure out
> what blocks are "prorected" by each PAR article.

That kind of depends on why articles are lost in the first place.  If
articles close together are more likely to get lost than articles that are
spread out, then consecutive coverage is the way to go.

>> The only real difference is how the data is being split up...Maybe
>> allowing both is the best solution.  Allow the header to specify
>> consecutive sets of articles and/or bytes, or uniformly spaced sets of
>> articles and/or bytes.
> 
> Yeah, you can do that, but why?  Why is supporting both better than one?
> What does it buy you?

Flexibility!  (I'm a CS major, so I love for everything to be completely
generalized)

You're probably right, the added complexity isn't worth any of the
possible benefits.

>> In the end, I think it's the specification of what data is being
>> protected with parity that is really important, not what that data is.
> 
> Yeah.  Eacatly.  Each _article_ of PAR data posted needs to have a
> specification that allows the download tool to know exactly what data
> from the full file is being proteced.  The only question is how complex
> does the language need to be and what does it need to be able to
> specify.
> 
> The download tool is going to have a very complex problem of looking at
> the articles on the server, and looking at it's internal knowledge of
> what bytes from the file it has, and what is still missing, and what PAR
> articles it might have already downlaoded, and trying to figure out what
> it needs to download to complete the puzzle.  Given the fact that the
> data posts on the server can be all different sizes, and the PAR posts
> can span all sorts of different ranges, and the data currentely needed
> may have nothing in commong with the alignement of the articles on the
> server, the job of figuring out what to download in order to minimze
> waste I suspect is a very complex problem.
> 
> Does allowing PAR data to span non-consecutive segments make this
> somehow easier or better?
> 
> I really don't have the answers to that yet.

Well, let's stick with 8-bit parity data spanning consecutive segments for
now, and get some specifications and test implementations out there :)

Also need to figure out how to encode the parity data...Hmmm...

Cheers,
Chris
Technical Details
Message-ID: <pan.2003.02.22.17.42.19.973258@rogers.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!nntp.cs.ubc.ca!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!news03.bloor.is.net.cable.rogers.com!news01.bloor.is.net.cable.rogers.com.POSTED!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> <20030102152631.435$cR@newsreader.com> <20030104175550.818$mI@newsreader.com> <20030105223458.280$SO@newsreader.com> <20030106051307.259$0O@newsreader.com> <20030130214837.046$fc@newsreader.com> <20030206203828.211$Vw@newsreader.com> <20030212160144.071$NF@newsreader.com> <pan.2003.02.19.08.34.56.817883@rogers.com> <20030221183059.584$i2@newsreader.com>

Show Full Headers
Complete Article Headers
Message-ID: <pan.2003.02.22.17.42.19.973258@rogers.com>
Subject: Re: xBin and PARity files
Date: Sat, 22 Feb 2003 17:42:21 GMT
From: "Chris" <nobody@rogers.com>
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> <20030102152631.435$cR@newsreader.com> <20030104175550.818$mI@newsreader.com> <20030105223458.280$SO@newsreader.com> <20030106051307.259$0O@newsreader.com> <20030130214837.046$fc@newsreader.com> <20030206203828.211$Vw@newsreader.com> <20030212160144.071$NF@newsreader.com> <pan.2003.02.19.08.34.56.817883@rogers.com> <20030221183059.584$i2@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!nntp.cs.ubc.ca!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!news03.bloor.is.net.cable.rogers.com!news01.bloor.is.net.cable.rogers.com.POSTED!not-for-mail
User-Agent: Pan/0.13.3 (That cat's something I can't explain)
Newsgroups: news.software.nntp
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Lines: 160
NNTP-Posting-Host: 24.114.32.59
X-Complaints-To: abuse@rogers.com
X-Trace: news01.bloor.is.net.cable.rogers.com 1045935741 24.114.32.59 (Sat, 22 Feb 2003 12:42:21 EST)
NNTP-Posting-Date: Sat, 22 Feb 2003 12:42:21 EST