🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #57470

Re: Using Message-ID to store binary file information

#57470
From: J.B. Moreno
Date: Wed, 20 Mar 2002 20:58
186 lines
10380 bytes
In article <20020320140409.897$WW_-_@newsreader.com>, 
 Curt Welch <curt@kcwc.com> wrote:

> "J.B. Moreno" <planb@newsreaders.com> wrote:
> > Defining a Message-ID standard format for binary messages would not
> > only mean it was included in the overview, but would mean it could
> > be acted upon by servers at transport level.
> 
> I'm normally against trying to put anything besides the date into a
> Message-ID.  Everybody wants to put something into the Message-ID and
> even though a lot of ideas about putting stuff in there is
> interesting, none of it seemed truly worthy.

Well, I think some of it has proven useful -- user id tokens for
example (the form of the token isn't as important as it's presence).

> But the idea of having a standard Message-ID format for binary file
> segments seems like it might have some value.  As you point out, if
> the complete file size was there, news servers could reject articles
> based on the Message-ID.

I was talking about at the transport level, I didn't expect the server
you are posting to to reject articles because of file size, except
possibly when they have monthly bandwidth limits which you are about to
exceed.  But on thinking about it, it might be that it'd be done even
for individual articles -- servers with "no binary" policies might make
an exception for smaller articles.

> The problem however is that once you put one thing in there, then
> everyone starts to argue about what else should be stuffed in there. 
> Group names, revision numbers, author IDs, etc etc.

None of that makes sense (with the possible exception of author id's)
for binaries.  So, I don't think a slippery slope argument is valid,
you want to know that it's a binary and that it is connected to some
other binaries, but not much more.

> 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.  Number of parts. 
Perhaps the encoding method (remember that this is *NOT* something that
is intended for yEnc or UU or Base-64 or any other particular encoding
method, instead it should be used for /all/ encoding methods).

> At the low end, you could put a marker which simply indicated that the
> article was a binary - perhapps also meaning it conformed to some new
> standard for encoding binaries on Usenet: $ubf$
> 
> You could put in the full file size which this segment was a part of,
> Something like: $fs=3a74f$ (using hex to help compact it - or you could use
> a base-64 type encoding to compact it further).  Hex takes 8 characters to
> hold a 32 bit number but base64 encoding only takes 6.
> 
> 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?

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).

> You could thrown in the md5, which would be a big waste of characters:
> 
>          md5=6ba6b1808d70fea97d7f64001144a0d6
> 
> Or you could create something much smaller like a 16 bit version of
> the full md5 to help match files but not to to uniqly idendtify them:
> 
>          m6=a0d6

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.

> If the full file size was there, then the short hash + the file size
> would be a good indication of a match.  But if it wasn't good enough,
> then you would still be stuck with the need of putting a larger hash
> somewhere else in the headers.  Maybe a 32 bit hash would be strong
> enough?  It's been implied that crc32 isn't very good, but maybe 32
> bits from an md5 of the file would be strong enough that it could all
> be placed in the Message-ID???

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?

> So, to see what this looks like, I'll make up an example.  Let's assume
> we are posting the last segment of a 500 MB file and the segments are
> 500KB each. (I'm using numbers on the larger end to show what an ID will
> look like with farily large numbers in it).  And I'll put in a 32 bit
> hash encoded in base64 as well: (or why not a 36 bit hash):
> 
>   <.date-stuff.$h=uJb8Ex$s=eP000$o=eNb00$l=A900$@somehostname.com>
> 
> In the above, h is the 36 bit hash, s is the filesize, o is the file offset
> for this segment, l is the length of this segment. A 500K single part file
> would leave out the offset and length so it would look something like this:
> 
>   <date-stuff$h=uJb8Ex$s=A900$@somehostname.com>
> 
> Compared to an airnews id which usenet is already living with:
> 
>   <99372C2973C6A746.C6C49A8CCD3EA397.1810703A62E23B4F@lp.airnews.net>
> 
> If the hash and the size were always required, these IDs could be spotted
> by looking for the pattern: "$h=......$s=.*$"  I'm guessing that would be
> good enough to reduce false positive hits to an acceptably low level.

What about including the information on the RHS instead of the left?

<date-stuff@uJb8Ex.A900.ubin.invalid>

(ubin meaning usenet binary).

This should eliminate any chance of (random) false positives, while at
the same time reducing the size of the required message-id.

> As much as I dislike the idea of putting "header" information into the
> message-id, I think this has some potential. It forces the file segment
> informaion into a very compact form so header downloads won't be too
> adversely impacted.  It gives newsreaders everything they need with no
> changes to the current servers (other than the fact that the few servers in
> the world that don't allow you to specify the Message-ID would not be
> useable for posting binaries - but the users could still read binaries fine
> from those servers).

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.

> 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.

> > (I.e. if you include an overall size component, servers could reject
> > messages of a size they don't want to carry).
> 
> Current servers have no real abilty to filter on Message-ID, so this
> isn't something they could make use of now, but it would be very
> straight forward to add to any server.  And the very cool thing
> is that a server could filter their incomming feeds by full file size
> and make changes to their filters without having to contact their peers!

Exactly what I was thinking of.

> Or you could simply filter all binaries from the feed if one day this
> convention became the norm instead of the exception.

Yep -- this would allow a text only server to carry all groups.

> Servers at some point could start to reject posted binary articles that
> didn't have a valid "binary" message-ID to help force the transistion
> of Usenet to this standard.  

Yep.  And assuming that binaries continue to outpace regular articles,
it wouldn't be hard to decide when the time came to force the
transition either -- just compare the number of binary MIDs against the
number of non-binary MIDs.

> And they could check articles at time of post to make sure the
> Message-ID was consistent with the data in the article (all you could
> really check was the length of the encoded data in the article - but
> that might be useful).  Doing that for example would prevent abuse
> where a hacker would post small fake messages in an attempt to block
> parts of a post from getting out to the net by guessing at the
> Message-IDs of the other parts that had not yet shown up.

Good idea, I hadn't considered that.

-- 
J.B. Moreno
Technical Details
Message-ID: <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!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!feed1.newsreader.com!news2.newsreader.com!flame.newsreader.com!planb
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>

Show Full Headers
Complete Article Headers
Message-ID: <200320021558402413%planb@newsreaders.com>
Subject: Re: Using Message-ID to store binary file information
Date: Wed, 20 Mar 2002 15:58:40 -0500
From: "J.B. Moreno" <planb@newsreaders.com>
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>
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!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!feed1.newsreader.com!news2.newsreader.com!flame.newsreader.com!planb
Newsgroups: alt.usenet.offline-reader.forte-agent,news.software.nntp
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8bit
Mail-Copies-To: nobody
User-Agent: Thoth/1.6.0 (Carbon/OS X)
X-Face: ]lUBtDImSD_`E"<*ZgyJUoCT\=CdRLFX4qCMLK[xy^L7v|uX|f8`cFDd*PaH8
  N*x>d^h
X-Trace: flame.newsreader.com xs9ihLgDtpLnlhGE9jE4-vdvy-5cAv+YzCyYlRhONGMoNY
Lines: 185