🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #62593

Re: xBin and PARity files

#62593
From: Thomas
Date: Mon, 30 Dec 2002 23:20
130 lines
7242 bytes
Rene wrote:

> Blocksize
> =========
> The PAR-system as used now works with filesets. A fileset is simply a big
> file splitted into several few. A PAR-Parityfile needs to be at least as
> large as the largest file in the fileset.
> 
> Now we don't split files in xBin. But we can do as if we were. All we need
> to do is to define a "virtual segment size", ie a size at which we would
> split a file if we were splitting it. This virtual segment size then
> defines the size of all parity files.

As messages get lost individually, it makes sense to use the message size as the 
PAR block size.

This means that the PAR is only applicable to a certain section of a large 
posted file. But it is a bit more efficient.

Say you have a 500 part post. Say we lose two articles. If a PAR part was two 
articles, you probably need 2 PAR files to recover - total 4 articles.

If a PAR part is a single article, you'd still need 2 blocks. And a PAR for the 
beginning wouldn't help for a missing article at the end. But it would be 2 
articles PAR data posted.

Now, we try the case where people are missing 2 articles randomly over the file: 
some missing the 2 fist, others the 2 last, etc. This would need 4 articles 
again. Not worse than using larger PAR files.

This is easy enough to understand if you realize that a too large PAR file 
transfers correction data for the next article, that may or may not be missing.

If articles sizes are different, just pad the short articles with 0's before 
generating the PAR data. But the length of the missing article should then be 
known somehow.

As Curt noted, this also makes a PAR part the stand alone entity that it should be.

> The virtual segment size in any case must be known because not only the
> originator of a post may create parity files but anyone having that file in
> full. Having mixed size parity files from different people would
> complicate the maths involved in calcualting and reconstructing data by a
> huge amount.
> 
> As of this time's writing, I'd go with a fixed size for this virtual
> segment of about 10MB. This would lead to people using normal reposts for
> small files but using the par-system for larger files.

Hmm.. I see teh problem where files get reposted in different article sizes. But 
still, PAR needs to paint in missing articles. And for that, it needs to 
traverse the already posted data in a consistent manner.

I think that PAR can only work if postings are done in consistent sizes, with 
the last block not beaing exactly the right size.

> Therefor, for the secure operation of xBin with parity, an xBin compliant
> newsreader MUST check the hash tree after each attempt at parity repair.
> That way, problems are detected and a corruption of the file is not
> possible.

I think that is the only solution. Not feasible to check on servers.

> Let a newsreader who should produce PAR files use the following system:
> 
> 1. It really splits the original file into N segments, all having the size
> of virtual segment size (yet to be determined). The filename of those
> splits is the original filename added by a dot added by a three digit
> number starting from 000: a.000, a.001 ...
> 2. Use an ALREADY EXISTING external application to create M parity files.
> 3. Delete the splitted files.
> 4. Post the Parity data files according to xBin rules for parity data.

If it would use the net article size as the segment size, the PAR would be most 
efficient. But you would need to encode also to which segment range teh PAR 
files apply.

> A newsreader wanting to use parity files to complete a file does the
> following:
> 1. Determine how many parity files are necessary to complete the file
> 2. Get those parity files
> 3. Split the incomplete file into parts of virtual segment size each. Rule
> for nameing the files as above.
> 4. Use the ALREADY EXISTING external application to fix the files using
> parity data.
> 5. Concatenate the splits back to one single file, verify tree hash.
> 6. If ok, delete former incomplete file -> done. If not ok, delete parity
> files, delete splits. Try to get more parity data.

Nothing here changes, just the parts being smaller. It just happens that missing 
data is exactly a PAR block in size, making for easy to fill holes.

It is much more efficient - just like it would be more efficient to repost just 
article 3 of .r13, instead of the whole .r13 (something that xBin tries to fix, 
but we forget again with PAR).

> The advantage is: With minimal effort, parity technology can be implemented
> into xBin, NOW ! No adaption of PAR-technology needed, it's already there.
> 
> The disadvantage is: Uses more diskspace because of splitting, Parity files
> have more meta-data than is actually needed.
> 
> Problems: Two users having the same file may have different file names, so
> if those each create some parity files, they won't be able to fix data
> because their meta-data does not match. So we chose as "basefilename" for
> the split files the file-hash in an appropriate encoding (base64..)
> 
> So now we're really at the end of my parity with xBin excurse. Comments?
> Additions? Corrections?

I hope you see that having each PAR part span more than a single article is 
inefficient. But the overall idea should work. Any idea on how much extra 
metadata would be involved? If it means the PAR file has to be split anyway, 
that would be bad news.

> I *really* vote for the inclusion of Par-technology into xBin, and into
> xBin v1.0, not later.

Agree. The PAR parts should be easy to identify by something that looks at 
headers. A feeder could examine the posts, check what block ranges it is missing 
for a file, als allow so many PAR files to come by plus some extras.

Other point on PAR: is there a limit on how many PARs can be generated (say max 
10% missing on a file)? Hopefully, using PAR and not reposts means Curt's fear 
of endless automatic reposts (which I share) does not become true.


Thomas

Technical Details
Message-ID: <ix4Q9.2961$T41.7255@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!logbridge.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!news.completel.fr!gitoyen!deine.net!amsnews01.chello.com!amstwist00.POSTED!not-for-mail
References: <20021230133312.202$K5@newsreader.com>

Show Full Headers
Complete Article Headers
Message-ID: <ix4Q9.2961$T41.7255@amstwist00>
Subject: Re: xBin and PARity files
Date: Tue, 31 Dec 2002 00:20:46 +0100
From: Thomas <zak@spam.invalid>
References: <20021230133312.202$K5@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!logbridge.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!news.completel.fr!gitoyen!deine.net!amsnews01.chello.com!amstwist00.POSTED!not-for-mail
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: news.software.nntp
In-Reply-To: <20021230133312.202$K5@newsreader.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 129
NNTP-Posting-Host: 24.132.6.5
X-Complaints-To: abuse@chello.nl
X-Trace: amstwist00 1041290446 24.132.6.5 (Tue, 31 Dec 2002 00:20:46 MET)
NNTP-Posting-Date: Tue, 31 Dec 2002 00:20:46 MET