🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #57476

Re: Using Message-ID to store binary file information

#57476
From: Curt Welch
Date: Wed, 20 Mar 2002 22:41
206 lines
10934 bytes
"J.B. Moreno" <planb@newsreaders.com> wrote:
> In article <20020320140409.897$WW_-_@newsreader.com>,
>  Curt Welch <curt@kcwc.com> wrote:

> > Ignoring the slippery slope problem of putting anything into
> > Message-IDs, what would you suggest putting in there for binaries?
>
> Well, first and foremost -- that it's a binary.  Then the size.  Then
> something that is reasonably compact and unique to the file so XPAT
> searches can be done looking for individual parts.

Ah, XPAT searches.  I hadn't thought about that. That's another potential
benefit.

But even without XAPT, just doing a XHDR message-id to dump the IDs for
an entire group is something that works today on all servers (I suspect)
and would give a binary download tool all the info it needed to locate
potential articles for missing parts (if this was a standard which was
all of Usenet was converted to at some point).

> Number of parts.

I think we need to get away from that.

> > You could throw in the segment offset and size:
> >
> >          so=3Hw6,ss=y7J
>
> What benefit do you expect to have from having the segment size and
> offset included in the Message-ID instead of elsewhere?

Well, to start with, we need to move away from the idea of part counts
or part numbers and move to the idea of byte ranges to allow newsreaders
to correctly find the segments they need to fill in holes.  This is needed
to replace the idea of part number so reposts no longer have to match
the size of the orginal post.

When I started to write my article, I assumed that we couldn't put
eveything in the ID (it would make the ID too large) so we would just put a
few thigns that was most useful (like the full size of the binary the
segment was a part of).  But by the middle of my article, I realized it was
actually possible to put everything that was needed into the ID and still
keep the Message-ID a resonable length (long, but not unworkably long).  So
if we have completly elimited the need to add other headers or to hide data
in other parts of the header, why not put it all in one place?  That was
what I was thinking.

If you put all that stuff in the ID, then the newsreader has
everything it needs to find articles without having to do XHDR or
HEAD commnds.  You could move that stuff into a fake id in the References
and still have it show up in XOVER, but then then the nice trick of a
single XHDR command to get everything you needed would not work.  You would
have to do two and get a lot of "real" References: data for the text
articles that you cared nothing about.  Putting it all in the ID seems
generally cleaner to me.

There is other information needed as well, like file name, and checksums
for the article, but that can all be dealt with how it's done now with
the various standards (MIME, uuencode, yEnc).  Those are things the
newsreader would need to know until after it started downloading the
articles.  And the subject alone is all the user needs to decide what to
try to download in the first place.

If moving things like offset and part size into the Refferences section
to prevent excessive bloat in Message-IDs makes sense, that could be done.

But once I realized that we could but everything that was needed into
the ID and not worry about any other new headers or tricks it seemed
to make more sense to me.

> I'm not suggesting that all of the binary information be presented in
> the Message-ID, just those parts that you want to have as quickly and
> easily as possible.  Above I mentioned encoding method, but only
> because it might help with filtering (and deciding what encoding
> methods to support).

Putting encoding method in there could help.  But it kinda implies
that we want to support lots of different methods.  And it creates
the complexity of adding new names later for other new encoding
systems.  You could attempt to kill that by defining only uuencode,
MIME, and yEnc and say that all new methods MUST be done as MIME
or not done at all.

But to be honest, I'd rather just leave the encoding method out and
not make it "easy" to support many standards - to encourage the net
to move to one standard (whatever that is).

> Well, as you say, you'd want to use base64 so both of the above would
> be somewhat smaller, and you're right that you probably don't need (or
> want) the full MD5 hash.

Some research could help determine how many bits are really justified
and what algorithm is the best for giving us those bits.  But if everything
is encoded with base64, then a total which is a multiple of 6 would
be logical.

> I'm still somewhat skeptical about doing a MD5 or a CRC based upon the
> fact that you have to scan the article twice -- I'm not sure how long
> that would take.  You're using a 500 mb file below as an example, how
> long would it take to read that and compute an MD5 for it?

This was discussed elsewhere recently.  MD5 is as fast as CRC-32 and both
are probably at least 10 times faster than disk-io.  So the answer for
most machines has nothing to do with the CPU time and is only a function
of the disk speed.  Disks run 10 to 20 MB per second these days, so you
are talking less than a minute to scan a 500 MB file before posting could
start.

For a real world test, on a 200 Mhz Pentium Pro box running FreeBSD,
It took 2.8 seconds to calculate an MD5 on a 23.8 MB file which was on
an old cheap IDE drive. (which is an IO rate 8.5 MB/sec)  It would take
over 2 minutes to post that same file to Usenet over a T1 line.

I don't see the time for the scan being a killer as long as we kept with
a hash fucntion that was a lot faster than the disks.  MD5 is nice because
it is so fast.

> What about including the information on the RHS instead of the left?
>
> <date-stuff@uJb8Ex.A900.ubin.invalid>
>
> (ubin meaning usenet binary).

It's an option.  But I believe some people in the past felt they wanted to
keep the RHS a real domain name and even allow their server to change the
RHS of a user supplied ID.  I don't know if any server is actually doing
that today.

It doesn't really save much in terms of bytes in the Message-ID.

Base64 needs two characters other than letters and numbers.  MIME uses
+ and /.  That's likely to cause problems on the RHS. We could use - and
something else (what else would be used?).  Or stick with hex or make
up a base32 encoding.

And domain names are case insensitive and there's always been an old
hanging issue of whether <1@TEST.COM> should be treated as equal to
<1@test.com>.  Even though most news servers would treat those two IDs
has being different, I think in theory they "should" be treated as
equal.  This issue could get in the way of puting base64 on the RHS
but wouldn't stop base32 or hex from working.

> This should eliminate any chance of (random) false positives,

I'm sure we can reduce the odds of false positives a few orders of
magnature below where we need it to be with no problem with data in the
LFS.  Increasing it futher by using the RHS encoding I don't think is
helpful.

> while at
> the same time reducing the size of the required message-id.

<date-stuff@uJb8Ex.A900.ubin.invalid> is really not much different than:

<date-stuff$ubin=uJb8Ex.A900@shortname.com>

Most of the size savings from my examples only happend because you left
half the data I put in there.  And you leave out a valid domain name
which I think some admins might not like.  But it's an option to think
about.

Using the RHS for the hash and the size makes XPAT searchs a lot
easier doesn't it?  As in:

  XPAT Message-ID 1- *@uJb8Ex.A900.ubin.invalid>

But, I guess that's really not easer than:

  XPAT Message-ID 1- *$h=uJb8Ex$s=A900$*

> Well, if you used the RHS and allowed "invalid" to be replaced with the
> actual host name if the server required, they might change the way they
> generate message-id's.  Or simply make an exception for labeled
> binaries.

Good point, the standard could all be defined in the context of doman
names so people could replace invalid with a real domain:

   <date-stuff@huJb8Ex.sA9000.o3443.lA900.ubin.isp.com>

If we get enought people to think about this, we could figure out what
made the most sense - i.e. what was the most flexible and caused the
least problems.

The more complex issue is what should or should not be put in there
and if we should even consider this at all.  Figuing out the best format
is not the hard part.

> > It's also 100% compatible with all current formats used for posting
> > binaries to Usenet (uuencode, MIME, or yEnc) -- as long as you include
> > only one file or file segment in each article.
>
> And since that is the case in the VAST majority of articles, I think
> that any loss in ability to do multiple files in one article is quite
> acceptable for the benefits received.

Maybe for those that wanted to put multiple binaries in a file we could
even define a "correct" way to code it.  For example, just by encoding
it as if it were one big file made up by concatenating all the small
files together.  The total size would still be valid and useful in that
case.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20020320174111.780$V8@newsreader.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <us1c9ucatbi49fiq685eolg8jf73sjcta0@4ax.com> <3c98344b.1993605@news> <mgfc9uc7d9l0n2tprssu340g22r96uuseu@4ax.com> <20020318154507.410$TU@newsreader.com> <9hlc9u8ga789vu6hfcun0oln29ae6mck5m@4ax.com> <20020318160827.211$fq@newsreader.com> <ldmc9u48omjm6sf5vj9fn54c83tob9u69g@4ax.com> <20020318181949.333$Fq@newsreader.com> <180320022351466617%planb@newsreaders.com> <20020320140409.897$WW_-_@newsreader.com> <200320021558402413%planb@newsreaders.com>

Show Full Headers
Complete Article Headers
Message-ID: <20020320174111.780$V8@newsreader.com>
Subject: Re: Using Message-ID to store binary file information
Date: Wed, 20 Mar 2002 22:41:11 +0000
From: curt@kcwc.com (Curt Welch)
References: <us1c9ucatbi49fiq685eolg8jf73sjcta0@4ax.com> <3c98344b.1993605@news> <mgfc9uc7d9l0n2tprssu340g22r96uuseu@4ax.com> <20020318154507.410$TU@newsreader.com> <9hlc9u8ga789vu6hfcun0oln29ae6mck5m@4ax.com> <20020318160827.211$fq@newsreader.com> <ldmc9u48omjm6sf5vj9fn54c83tob9u69g@4ax.com> <20020318181949.333$Fq@newsreader.com> <180320022351466617%planb@newsreaders.com> <20020320140409.897$WW_-_@newsreader.com> <200320021558402413%planb@newsreaders.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: alt.usenet.offline-reader.forte-agent,news.software.nntp
X-Trace: NewsReader.Com Zw_N@ArRvqoRSLLt+4x8=okBKe2@JQmJuh+kvLiFWs7=_9RPU
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: 205