Article View: news.software.nntp
Article #62743Re: xBin and PARity files
From: Rene
Date: Sat, 04 Jan 2003 02:29
Date: Sat, 04 Jan 2003 02:29
428 lines
21829 bytes
21829 bytes
curt@kcwc.com (Curt Welch) wrote: > Rene <invalid@email.addr> wrote: > > 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. > > There's the complexity that par files are limited to the number of > virtual segments they can cover depending on the word sized used in the > RS algorithm. I belive, but do not know, that all the current tools out > there use 8 bit words and therefore limit the number of files/virtual > segments which can be proteced by the par data to something like 128 or > 256. Yes, the number of virtual segments + par-files/segments must be smaller than 2^wordsize. The limitiation of the PAR-system used by FS-Raid for example is indeed 256. Quoting the help in FS-Raid: "At the present time, a PAR file is limited to 256 total files. In other words, the total number of files (parity files plus data files) may not be greater than 256. This limit is related to the mathematical algorithms used to recover missing data. Therefore, in order to push this limitation back (to, say, 64000 files instead of 256) the existing programs would need to be modified and a revised file format would need to be implemented. " > In your post here, you seem to assume that each PXX file will cover the > entire xBin file - i.e. all the virtual segments. I suspect that > assumtion is not going to work. Yes this is my base assumption. Anything else makes it more complex and is not desireable, imho. > For one, if the external tools are limited to 128 files which they can > protect, then you will have to create virtual segemnts, and PNN files > which are a min of the xBin file size / 128. A 2GB xBin will will then > need each PXX file to be 16MB. That ends up being posted as 32 some odd > articles, of which 3 get lost, so how to you repair the lost articles > from the par files? We cannot protect PAR files from forgery and we especially cannot protect them from getting dropped by any server. This is simply the risk of the PAR files. A PAR-file is quite "strong" in the sense that one single PAR file that makes it through, can repair a gap of its size anywhere in the file. All you do on the client side therefor is seeing how many PAR's you will need and then try to get them. Using the xBin-Signature header, a newsreader knows if that's possible or not. It sees if a par file is incomplete and simply tries to get another one. > Also, to generate a missing virtial segment using par data, you have to > scan and do calculations over all the virtual segments protected by PAR > data. So if you have a 2GB file, the program to reconstruct the missing No a newsreader needs to track which blocks it already has anyway. Its quite easy to expand that on the virtual segments: If all blocks from virtual-segment-start to virtual-segement-end are there, then that virtual segment is ok. > data has to scan the entire 2GB file. And depending on how clever to > tool is, it will probably end up scaning the entire 2GB file for every > virtual segment it has to recreate. Well when you attemp to repair a file using the PAR-system, you have to touch every single byte in the file anyhow. (The existing ones will be read, the missing ones will be read out of the PAR-file and written to - of course there's calculation too) > I suspect this is going to be unworkable for very large files. Depends on the size of the virtual segment (and wordsize of the RS-algorithm). If the limit on the number were not there, there would be no problem. So to solve the problem, we either need to increase wordsize (in the RS-algorithm) or we need to set the virtual segment size to a value such that we will always remain below 255 segments. > > But how should a newsreader react if the virtual segments does not > > match (align) with the downloaded blocks? Ie consider the following > > picture: > > > > +-----+-----+-----+-----+-----+-----+-----+ > > | A1 | A2 | A3 | A4 | A5 | A6 | A7 | articles > > o o o x x x x x x x x x o o o o o o o o o <--- xBin blocks > > � f1 � f2 � f3 � virtual segments > > +-------------+-------------+-------------+ > > This can work. But it means you end up having to download a lot of extra > par data and do a lot of extra par calculations. If you above example, > if articles are 500KB each, the your virtial segments, and each par file > is 1.1MB each. Well, you can't get a half PAR-file. Either you get a full one or you don't have it. The problem is, yes at the edges there is some loss. It's still better than full-reposts or many reposts. But it is compatible to reposts. A newsreader can get reposts first, if it sees some, filling some more gaps and then starts to cry for PAR-data. > If the guy happens to be missing articles A3, and A10, both which span > virtial segments, he will need to "fix" 4 virtial segments, so he will > need 4 PAR files of 1.1MB each. So in order to fix 2 missing 500KB > articles, you are asking him to dowlonad 4.4MB of par data. No one is > going to like that. Yes, it would be clever if virtual segments span complete article boundaries. But that's not going to be. Article size will be arbitrary and can change. Actually with the algorithm posted for article-size levelling, we are even doing this for one single poster. But xBin is designed for and works with several posters, all sending the file with different article size. Look at PAR-files for "bulk-repair". Fine fixes can be done easier with reposts. But reposts are place-specific whereas PAR-data is not. > And, because your par files are split across multiple articles, you risk > losing one of those articles and having once again wated usenet bandwidth > for some sites who have unuseable segements from another multipart post. Yes. That's the risk. But the number of PAR files is usually quite lower than the number of reposts. Combining both methods should get the best out of this, that's why I propose inclusion of PAR-technology into the xBin standard. > I would propose always using "virtual" segments that can fit in a single > arictle. This way, the PAR files will always be posted as a single > article, and if some are lost, no harm is done. You just have a few less > par files to work with. Each par article will still remain useful. That will limit the size of PAR-files downto 1MB max, preferably something in the range of 300KB. This then increases the number of virtual-segments over 256 for any file > 75MB. Doable if we can increase the wordsize of the RS-algorithms to 16. However the assumption of PAR-data being as big as an article max means that usenet is very bad with completion. But its not really THAT bad, is it? I look at PAR-data as "bonus"-data. Fetch some if you can and need some. > And, because I think forcing the PAR repair tool to scan the entire 10GB > file to replace a few missing 500KB sections is going to be unreasonable, > (even more so when you find out the PAR was forged and has given you crap > after all that work downloading it and wiating 20 minites for the repair > tool to do number crunching over 10GB of data), I think we are going to If you do a repair attempt, you must go through the whole file, no matter how small the gap(s) is. That's why I say for small filesizes/gaps, reposts are better. > have to limit the range of virtial segments each PAR article will cover. > So you might divide the huge xBin file into virtual segments which each > cover N hash blocks (virtial segements should align with hash blocks I > think). If the hash block size is 22500 like we have talked about, and > you wanted to post 400Kish par files, then you could use a virtial > segment size of 18 hash blocks. You could them post a set of par > articles, P01, P02, P03 etc which cover the first 100 virtial segments in > the file (40MB of data), and another set of hash files for the next 100 > virtual segments, etc. as required, for the entire file. Uh this adds a layer of complexity without giving much in return. The power of the PAR-data comes from the fact that they fix any segment anywhere in the file. Now this power is lessened if they are "range-locked". Additionally we need to clearly define which range which PAR-file is for and a newsreader needs to do the same for its gaps. Also when the PAR data spans the full file, then after a repair attempt, you can scan the file, calculate the hashes and then you know instantly if everything went right, because if so, you can recalculate the hash-tree and you will land at the root. When this falls away because PAR-files are range-locked, then you end up with having not all data to recalculate only these ranges. It is still an all or nothing thing: You need to have all the PAR-data for all the ranges with gaps until you can start the fixing AND verifiy it. > > To distinguish such a parity file from a normal part of an xBin file > > however, there must be some change. One way to do that is to "overflow" > > the offset variable in the message-id of an xBin posting. > > Bizzare and not needed. Its just my first thought. I don't know the exact alphabet of identifiers you were already using so I didn't want to introduce my own which would might have caused collisions. > > What's also important is to give the sequence number of the parity > > data. > > Just add $P1$ in the xBin ID. That not only gives you the needed parity > file sequence number, the presence of tthe $P field tells you that this > is parity data and not normal data. Yes, that's one way it could be easily done. > The segment size should be used as it normally is - it tells you how much > data is in the current article. This however, for parity files, becomes > your "virtial" segment size because each parity article will span > multiple virtual segments of this size. Exactly. > $H hash > $S file size > $o segment offset in hash blocks > $s segment size in hash blocks > $P parity sequence number > $N number of segments spanned by parity data (100 in my example above) > > So, the data out of the full xBin file spanned by this parity data would > start at the $o offset, and would continue for $N blocks of size $s. > THis means the Message-ID for a PAR file will only have a few more > characters than a normal xBin articles. Should the message-id not contain only the hash ? This additional information is only relevant to xBin-compliant software which can get that out of the xBin-Signature header. I thought the data in the message-id is only there to make xBin posts easily findable. I wouldn't put more than the hash into the message-id. > Since we are re-using the $o and $s values, it would be very important > for all xBin applications to understand that the meaning of $P and $N > (even if they didn't support parity files) so they didn't mistake this as > a data segment). Yes. That's what I meant by having a xBin-compliant newsreader understand what a parity file is and what not. > But, then again, I guess that isn't as important because this data won't > pass the hash test so it would be rejected if the program was too stupid > to understand it wasn't meant to be file data. But shouldn't be downloaded if the software can't do anything with it anyways... > But here's the rub. Articles get lost, not virtual segments. And though > it's not all that hard for software to map the two, and figure out which > par files on the server are useful and which not, it means to fill in > holes, you end up haiving to downloading more par data than the amount of > "holes" you actually need to fill. People having to download will prefer > reposts instead of par because the par system makes them download more. Depends. At the end of the day, it's a social issue over which we have no influence. We can only make it as easy as possible. If I can get a Parity file now, which is larger but fixes my problem or wait for a smaller repost, I take the larger parity file. But then again I'm a low-volume downloader at your site, where your volume-limit for me simply means "infinite"... others may have to be more conservative. Depends how many users act like I do and how many contrary. > For the above example, you post one set of par files, which span only the > first 20 articles - because they are all the same size. Then you post > other par files which span the last 14 articles, because they are the > same size, and then you just repost the last fill if needed and don't try > to cover it with par data. So effectively you are saying we should split the one xBin file into files depending on the different article sizes and then treat it as three files (from your example?) If so, we would then get three different "P01" parity files for the same xBin file (ie we'd get three parity-sequences). This could all be hidden from the user, but its a complexity-increase that must be handled at the newsreader software. > So, if you post a set of articles each with this number of hash blocks > each: > > 20 20 20 20 20 19 19 19 19 19 19 19 19 > > You can then post par files of size 20 for the first 5 articles, and par > files of size 19, which cover the last files. And then the par files > exactly match the data they are replacing, and if you are missing 19 > blocks of data, you only need to download 19 blocks of par file to > replace it. Yes. But what happens if a xBin posting is expiring and someone other fills in with a different article size? Oh the mess ! Fixing the Par-size on article size is no solution in my eyes. > If you have N files missing, then you need N par files to replace them. > But, to generate even one missing file, you will need to use all N of > your par files. If you have 5 files missing, one par file alone is > useless and tells you nothing. Once you collect 5 par files, then you > can try to generate the data. As you generate each missing file, you can > attempt to check it aginst the parts of the has tree you happen to > already know. But, depending on alighment with other missing blocks, you No that's not possible. You can't use 3 out of 5 PAR-files to repair "a bit". It is really an all or nothing thing. You can repair, or you can't. But you cannot repair a bit. Or repair only the first gap. Look at it as the virtual segments taking up space as columns. If you repair you don't repair "from left to right", ie a vertical line starts to grow from left to right. But you repair with a "horizontal line" which slowly grows from top to bottom. Or to put it another way: If you have 4 gaps and four parity files and you'd stop the repair-process 3/4 through, then all the 4 gaps would contain 3/4 the correct data but would be empty in the last 1/4. > may not be able to reject it or to prove it's all valid. So the > application will be forced to support the idea that blocks have been > "repalce" but the quality is still unknown. So you have to continue to > reclaculate missing data not knowing if the work you are doing is a waste > of time, or not. Yes, but if the PAR-files span the whole file, you can recalculate the hash-tree, and arrive at the file-hash or not, telling you if it was successful or not. > And, with these par files which do not cover the entire file, even if you > have all the par files you need to reproduce the articles you are missing > from posts 21-35, and go ahead and reproduce the data, you may still not > be able to prove or dis-prove that the the articles you generated or the > par files they came from are valid because you may not have the parts of > the hash tree you need to figure that out. Yes. Another added complexity issue. > So, my point is this, if you are woking on a huge file 20GB which was > posted as 40,000 500K articles, and you missed a total of 500 parts, but > you found and downloaded 500 par files to fix all those holes (and you > have been working on getting this complete file for months), you can't > know for sure if any of those 500 par files are corrupted or fakes, until > you fill in all the 500 missing parts and then verify the entire hash > tree. Yes. > No one wants to find out a month later that the par file they grabbed was > bogus, but that another one posted 2 weeks ago that they didn't bother to > download because it was a duplicate, was in fact the real one they > needed. > > So I think we need a little more help being able to identify bogus par > files. I see no easy way in doing this. Because anyone having the full file should be able to produce PAR-files, not only the original poster. > But, here's an idea. > > If we include an X-Bin-Signature for each par file which is the same > signature you would put on an article spanning the entire par-set, you > would then have the hash values you need to veryify the entire par-set > once it was re-constructed (i.e. the 100 article set). Yes, but we possibly don't even want the entire PAR-set, I might only need one single PAR-file. Forcing someone to download an entire set of an arbitrary length just to be sure is even more wasteful. > Maybe there is a way to prove that par data is valid and we just haven't > thought about it yet. Possible, but I simply see no easy way at the moment for this problem. > The larger the range of articles you cover with a par file, the more > likely multiple par files will be needed, and the more likely a bogus or > forged par file is going to screew things up. So the answer may be to > use smaller article ranges if you are having problems with corrupted or > forged par files. Not necessarily, the range of par files does not matter. The completion of the original xBin file does. If it is complete I will never need a par-file. If only one article out of it got lost, I will only need one par-file. If more than one article got lost, then it depends on how many virtual segments the gaps are spanning. > Here's another option.... > > If we were to define a standard disk format for saving partially > downloaded xBin files which includes the data and hash data, then we > could create either a complete par tool to work on that data (hack some > of the current PAR utilities?) or just a data extraction tool which reads > the xBin data files and produces the par files which the current par > tools could use. That is a way I have thought about too. However I wouldn't touch the partially downloaded file. That file should have the size of the final file, simply that it doesn't have all the data. But the data that is already downloaded must be at the correct offset (ie a file with "gaps"). Then we need but a meta-file describing this file's completion status and hash-tree. > Ah, but putting 40,000 files in one directly is an issue if you are > dealing with a huge file.... Yes, the file to download should in any case only be one on disk. > Maybe the answer is for the newsreader to combine data segments whenever > it can. This is a possibility. Or as I propose, simply create a file of the final size and fill in data when it gets some (at the correct position) > I think we only need a $P and $N added to the mesage-ID and use the > Signature like I described. And the data encoded in the PAR file is pure > RS data with no meta data. I would have the sequence number included, but you're right, that too can be gained from the header, so it is superfluous too... > How to encode that is an issue though. If uuencode, what's the name to > use on the begin line? and for yEnc, does it look just like one small > file (I guess that's the answer), so then we just need to figure out what > name should be used for the file. The name is not real improtant, but it > wouldn't hurt to figure out something and specify it as the name. basename.Pxx basename would be the same name the downloaded file would get. Or the file-hash. > I guess it would fit with type type of stuff I was talking about above, > It could have a name which was something like 982761DF-2-A2.XBP where the > first hex number is the offset, the 2 is the parity sequency number, and > the A2 is the count of blocks spaned by this PAR file. Using P02 would > probably be wrong since the data would not be a valud standard PAR file > and would not attemnt to include the typical PAR meta-data inside the > file. Ok, that's a good reason not to use Pxx suffix, I must say. -- -------------------- http://NewsReader.Com/ -------------------- Usenet Newsgroup Service New Rate! $9.95/Month 50GB
Technical Details
Message-ID:
<20030103212914.998$3s@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!news.maxwell.syr.edu!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mailReferences:
<20021230133312.202$K5@newsreader.com> <20021230171837.399$Im@newsreader.com>Show Full Headers
Complete Article Headers
Message-ID: <20030103212914.998$3s@newsreader.com> Subject: Re: xBin and PARity files Date: Sat, 04 Jan 2003 02:29:15 +0000 From: Rene <invalid@email.addr> References: <20021230133312.202$K5@newsreader.com> <20021230171837.399$Im@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!news.maxwell.syr.edu!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail Organization: NewsReader.Com Subscriber Newsgroups: news.software.nntp X-Trace: NewsReader.Com APssKNQ5iQhmhCAylH/5tpyl9U28OR@OUib-ss@9nQ5+I5 Lines: 427