Article View: news.software.nntp
Article #64111Re: xBin and PARity files
From: Curt Welch
Date: Fri, 21 Feb 2003 23:30
Date: Fri, 21 Feb 2003 23:30
214 lines
12473 bytes
12473 bytes
"Chris" <nobody@rogers.com> wrote: > I've just read through the RS Coding pdf that was linked to somewhere in > this thread, and it seems that implementing a 16 bit parchive system > isn't that difficult. That would mean that the number of segments > covered + number of parity volumes could be up to 65536. 24 bits is > feasible as well, but 32 bits requires too much memory. Using a 16 bit > parchive would mean that your parity posts could cover a larger span of > articles. It's unclear to me what the cost and value of that is. I really feel the need to write some RS code to get a better understanding of this. 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). 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 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. 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. 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? 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. 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? I really don't know the answers to this and feel I need to have a better understanding of real RS code before I can make any judgement about which is more important. > 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. > In the Message-ID where you're specifying that > this article contains parity data, you can just as easily specify what > data it is protecting. As long as each article specifies this, it > doesn't really matter which method is used, does it? That mostly is what we are doing. The debate is really a matter of the amount of "power" you feel needs to build into the specification language. > Sorry, I'm not familiar with how you have specified the parity data > header so far, so bear with me. > > Is the specification that difficult? For parity data covering > consecutive articles you could do something like: > ~P1~S524288~R0-99 > meaning that this is the first parity volume, with size 512K and that it > spans articles 0-99 I think we were using ~S for the full file size, and ~s for the segment size. We used the normal offset and segment size to specify the first block of data covered by the PAR article and then simply added a repetition count to specify how many segments were covered (100 in your example). The word size of the RS algorithm was assumed to be fixed at whatever we picked for the standard - which would also limit the max repetition count. We could do something assuming the word size was defined by the count. So a count of 500 would meant the par data was using 16 bit RS words. This would allow download tools to only deal with PAR data that it knew it could work with I guess. > alternatively: > ~P1~S524288~R0,8388608 > meaning that this is the first parity volume, with size 512K and that it > spans data starting at 0 with virtual segment size 8MB Well, articles are not typically 8MB in size. So you can't post a single 8MB PAR article. If the PAR "files" are logically 8MB, that's fine, but then you have to post them in multiple parts. Which is also fine. But, the Message-ID needs to specify exactly what part this is and what data from the orginal file it covers. So think about what that means. If you break the file into 400KB articles, then you have 20 articles (of raw data) for each virtual 8MB PAR "segment". So, if I construct a single 8MB PAR file, I then have to post it as 20 articles of 400KB each. So look at the first PAR article you post. What data from the orginal "file" does it protect? It protects the first 400KB form each 8MB "virutal" par segment. Or, it protects articles 1, 21, 41, 61, etc from the orginal post. It does not in fact protect "the entire file". Each par article in that example only protects 1 out of every 20 posts. If I'm missing article 21, then I can doanlod that par article to "fix" my post. And I don't need to waste my time downloading the other 19 PAR articles which were posted. No mater how you split up the orginal file, and how you create PAR data, it's important for the tool to know exactly which segments of the file are protected by each PAR article so it will only have to download the PAR articles it needs and not waste it's time downloading 19 articles it doesn't need. To be able to specify the above, all you have to do is add a "skip count" of sometype, to the previous specification. i.e., you specify the first block protected by the par article using the offset and size, and then instead of assuming it's consecutive, you add a skip count of 20 (i.e. skip each 20 segments), and then use the same repitition count as before. But what does that buy you. Why is it better to have one PAR article covering posts 1, 21, 41, 61, and the next covering articles 2, 22, 42, etc, instead of having one PAR article covering posts 1-100, and the next cover article 101-200, etc? It just seems to me that supporting a specification language which allows for the coverage of non-consecutive ranges of data buys you nothing but unneeded complexity. > 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? > The CPU time involved is only less for the consecutive article method > when you don't intend to post redundant data for the entire file. No, it's identical for both systems. It's just an issue of whether each PAR article you post covers articles 1,2,3,4 vs 1,5,9,13. With both systems you have the same options of posting par data for the entire file, or par data for just parts of the file. > 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. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Technical Details
Message-ID:
<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!cyclone.bc.net!newsfeed.telusplanet.net!rip!news.webusenet.com!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mailReferences:
<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>Show Full Headers
Complete Article Headers
Message-ID: <20030221183059.584$i2@newsreader.com>
Subject: Re: xBin and PARity files
Date: Fri, 21 Feb 2003 23:30:59 +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> <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>
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!cyclone.bc.net!newsfeed.telusplanet.net!rip!news.webusenet.com!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 h9qCQCgakABnLHvdHyV@Lu9A,f0,6K5YgQYm@syeGCQ7TMDP,R
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: 213