🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #61353

Re: [FNTP] verifying that part reposts belong to a file - solution

#61353
From: Curt Welch
Date: Sat, 12 Oct 2002 17:07
135 lines
7942 bytes
Thomas <zak@spam.invalid> wrote:
> Curt Welch wrote:
>
> > And because when you loose an article you loose the reed-soloman data
> > that was posted with it, you would actually need to send more just 20%
> > additional data.  And it gets complex trying to figure out how to make
> > that work.  But I suspect there are answers if I think a bit more.
>
> Reed-solomon is not the right choice here. Reed-Solomon also detects
> errors, and that would be a waste of bits here.

RS is not a waste of bits.

Let me teach you a bit about how Reed-Solomon works.

It's nothing more complicated than your XOR system below. The reasons it's
used over XOR is that instead of being one equations (XOR in your example)
for calculating one checksum, it defines a set of checksum equations.  If
you are working with 8bit words (which is common), then RS defines 256
different checksum equations instead of just one like you get with XOR.

If you use only one of the RS checksum equations, then you have a system
that is identical in power to XOR.  You have N blocks of data, you
calculate the checksum block C which is the same size as your data blocks.
With only one checksum block, just like with XOR, you can replace any
missing data block, but only one missing data block.

And, like with XOR, the only error detection you can do is recalculate what
the checksum should be and make sure your calculated checksum matches. If
it doesn't match, you know you have an error, but you have no idea where
the error is.  It could be an error in the checksum block or any of the
data blocks.

The power of RS comes when you start adding more checksum blocks.

With 2 checksum blocks, if you find you have an error (because at least one
of the checksums doesn't match) then you have the extra power to locate
which data block is bad by stepping though each block, assume it's bad, use
one checksum block to recalcuate what it should have been, and then use the
other to verify that the new block makes the second checksum valid.  If
only one block is bad, then this is guaranteed to find and fix it.  So with
2 RS checksums for each dataset, you can both detect and correct single
data block errors.

To go further, you create a matrix with your data set like this:

   DDDDCC
   DDDDCC
   DDDDCC
   DDDDCC
   CCCCCC
   CCCCCC

Each D is a data set, and each C is a checksum block.  The Cs on the right
are the row checksums, and the Cs at the bottom are column checksums.

Each row and each column now has the power to detect and correct single
block errors on their own.  But when combined, in the 2D system, you can
fix much more than that because you have a lot more data to work with in
terms of figuring out which blocks are bad and which are good.

RS by itself does not use any more bits than XOR does, it just gives you
the option of doing more interesting things like the above - and it's the
more interesting things you do that wastes the bits.

> RS is too powerful here.
> Think of it as a RAID5 setup, where disks "know" whether they are broken
> or not.
>
> > And if we are trying to make it possible to post large files as 1,000
> > parts or more, then it really would be nice to support reposts with PAR
> > data instead of only reposts with real data.
>
> The simplest here would be 2 recipients, missing section 300 and section
> 400 for example. The reposter could post a XOR of these two sections,
> allowing both recipients to reconstruct their own missing part.

PAR files started as simple XOR PARity blocks.  They then realized it was
stupid not to use RS, and converted to RS checksum blocks.

The problem with posting an XOR block is that it's only ONE checksum block
and only has the power to fix a single missing missing article from the set
which the XOR covers.

The beauty of RS is that you can post multiple checksum blocks for the same
set of articles and anyone (even if they didn't send out a repost request),
can use them to fill holes anywhere in that set.  So if you repost 10 RS
blocks (using 10 different RS equations), for a set of 100 articles, than
any of those RS blocks can be used to fill a single missing article from
the set of 100, or any two of those 10 reposts can be used to fill any two
missing articles, etc.

> This can be extended (can it?) to cover an arbitrary number of missing
> articles in a single repost.

Yeah, it's extended by using Reed-Solomon checksum blocks instead of XOR
checksum blocks.

An XOR checksum can only be used to replace a single failed block.  The
only way to extend XOR to deal with multiple blocks is segment the articles
in different sets (like the 2D table from above). If you wanted to post two
XOR checksums, then you post one which covered all the even number articles
and one which covered all the odd numbered articles.  Then you could
replace up to two articles as long as only one was from the even set, and
one was from the odd set.  You could continue posting XORs for different
sets like that, say one for the first half of the articles, and one for the
second half, and one for every thrid artice, and one for every forth
aricle, etc.  The more you post, the more articles someone could recreate.
If you post 4 XOR articles, that would allow up to 4 articles to be
recreated, but only if the missing articles were correctly distributed
though the XOR sets.

RS is the general solution to this problem.  4 RS checksum blocks can all
be checksums for the same set of articles, and can be used to replace any 4
missing articles from that set.

> So if N recipients post a message with what they have and what they miss
> (or the have is implied...) someone can generate appropriate XOR posts
> that would be N times as efficient as plain reposting (for recipients
> each missing different pieces).
>
> It would be a good idea to reserve a special offset in the msg-id for
> this... the actual meaning of the data could be encoded elsewhere.

Reposting RS checksum blocks is useful and does need to be marked in the
Message-ID somehow.  You need to document which blocks of data the RS
checksum covers, and you need to document which RS checksum algorithm is
used.  You could probably extend that by including a code for an XOR
checksum algorithm, but I see little point to that because RS is just so
much better it's silly to encourage anyone to use XOR.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20021012130719.040$1H@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!bloom-beacon.mit.edu!ra.nrl.navy.mil!dca6-feed2.news.algx.net!allegiance!newsfeed1.cidera.com!Cidera!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <hpk9quk1cq0ti2reeu03epd0tgf4b8a8p0@4ax.com> <20021010014227.515$ke@newsreader.com> <quicqusrm520ic3bepeaorp4m82bum3lab@4ax.com> <20021011011847.958$mp@newsreader.com> <ao68ek.19k.1@news.isolution.nl> <20021011140416.691$Pw@newsreader.com> <ceQp9.691$Da.5655@amstwist00>

Show Full Headers
Complete Article Headers
Message-ID: <20021012130719.040$1H@newsreader.com>
Subject: Re: [FNTP] verifying that part reposts belong to a file - solution
Date: Sat, 12 Oct 2002 17:07:19 +0000
From: curt@kcwc.com (Curt Welch)
References: <hpk9quk1cq0ti2reeu03epd0tgf4b8a8p0@4ax.com> <20021010014227.515$ke@newsreader.com> <quicqusrm520ic3bepeaorp4m82bum3lab@4ax.com> <20021011011847.958$mp@newsreader.com> <ao68ek.19k.1@news.isolution.nl> <20021011140416.691$Pw@newsreader.com> <ceQp9.691$Da.5655@amstwist00>
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!bloom-beacon.mit.edu!ra.nrl.navy.mil!dca6-feed2.news.algx.net!allegiance!newsfeed1.cidera.com!Cidera!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com 44Uoa3_nbAd5ZlxGH2jEQqH6zBjDIPz4RPXO5DCF8VyFMXM-
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: 134