🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #63960

Re: xBin Message-ID convention

#63960
From: Curt Welch
Date: Sat, 08 Feb 2003 04:40
286 lines
14554 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:
> [Curt Welch]:
> >
> >   Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:
> >   > an xBin msgid is identified by a LHS (Left Hand Side of the @-sign)
> >   > containing the magic string "~XB~".
> >
> >   We had talked about ~, but then I ended up changing it to $ most
> >   for personal estheic bias in my posting program.  I think I could
> >   get used to ~.  I think $ makes it look more like a Message-ID,
> >   but ~, for the same reason, makes it stand out as "something
> >   special" which might be better.  And it reduces the odds of an
> >   accidential collsion even further.
> >
> >   But, one thing that would be nice is if the xBin-ID (~XB~....~~)
> >   could be used as an argument on DOS and Unix command line programs
> >   without having to put them in quotes.  $ is seen as a shell
> >   variable on Unix.  An argument starting with ~ is seen as a user
> >   home directory path substitution on Unix.  (i.e. cd ~curt).
>
> do you have a user named "XB"? :-) ~XB will be left alone unless that
> user exists.]

Not on FreeBSD's csh and tcsh.  That seems to happen with sh.  With csh you
get an "Unknown user" error.


> >   Also, for MIME Base 64 we get / and + where / causes problems on
> >   DOS (doesn't it? or is that up to the program?).
>
> I don't think we want to use something other than BASE64.  the "<" and
> ">" characters are a bigger problem for both Unix and DOS, anyhow.

Yeah, but I was thinking of the case of being able to cut and past the
Xbin-ID info out of the Message-ID so the <> would not be an issue.

> >   What about dot instead of ~?   .XB.HSuFjge8.S2Kj..
> >   Does normal LHS semantics make .. (double dot) invalid?
> >   Are the odds of a false match on a non xBin Message-ID too high with
> >   dot?
>
> it'd definitely be much more likely to appear.  lots of clients use
> dot separated components.

Yeah, and though dot makes it easy to read, it also makes it look a lot
more like an e-mail address.  The ~ will make it stand out as something
special which I think would be good.  With dot, people could see those IDs
and not notice them as anything different.  With all the ~, it will catch
your eye.

The other (and probably more valid) reason for a "clean" xBin-ID format is
so it can be used as part of a file or directory name.

One way to address that is to think about a standard "hex" version to use
there.

> >   I used ~H to mark the hash so it started with ~XB~H followed by
> >   the hash.  Did you leave that out on purpose or by accident?
>
> on purpose.  but thinking about it, the policy for what do with an
> unknown hashing scheme opens xBin to abuse.  if I said ~HK, the server
> wouldn't know the hashing method, wouldn't know it actually was a
> bogus hashing method, and couldn't automatically filter corrupt data
> (either during POST or during transit or expire).  it could still
> recognise duplicates, and calculate completion.
>
> still not sure how to formulate the policy a server or reader must
> follow when an unknown hashing method shows up, or rather, what to do
> when no known hashing method is included.

The hash is so important to the meaning that I think it might be wise to
treat an xBin-ID with an unknown hash the same way articles without an
xBin-ID are treated.  But like you, I don't think we have really thought
this through to the level we need to yet.  It will probably be wise to get
more working code in place first to get a better feel for how the code will
work.

The other issue about the hash is it's size.  It seems that if we don't
include the full 120 bits (which is what we have talked about), that a more
likely change in the future would be to include more hash bits in the
Message-Id.  We want to make sure all programs can deal with that
correctly.

> >   > S   total size.  the complete size of the file in octets.
> >   > mandatory.
> >
> >   The hash and the total size combined is the real xBin-ID for the
> >   file, not just the hash.  So I think it's important that this is
> >   not only mandatory, but that it comes right after the Hash.  This
> >   way, the first part of the xBin-ID is always the "file ID":
>
> I'm not too fond of fixing the order of the parameters, it could
> become a straightjacket.  what happens if the hash method changes?
> let's say the new hash method gets parameter "I", now the order must
> be ~XB~I...~S...~x...~~ ?  should we allow more than one hash method?

The "more than one hash" is a valid idea.

However, when I think of problems like that I tend to want to intentionally
not allow the hash method to be changed.  I think the odds of "needing" to
swtich to a new hash is so small (this isn't a security application), and
the problems that would arrise so great if you changed, that it would just
never happen.  The hash doesn't have to be unbreakable, it just has to be a
good hash with enough protection to prevent someone from easily and quickly
creating forged values.  And, even if the security of SHA1 is totaly
compromized one day, it will still act as a valid file-id, and as a valid
integrity check against accidential corruption.  It would just loose it's
strength against abuse.  Maybe, by the day that happens, it will make more
sense to add other security to the article instead of changing the xBin ID
hash.

But on the general idea of ording the arguments, I guess it's not too
important and would give us more future flexibility to allow the order to
be undefined (though it still seems "right" to suggest the order).  I'll
have to think more about that...

> we could allow that if the ordering doesn't matter.
>
> >       <~XB~H53F8b3f9C0/1~SVLIw~sBX5A~oBX5A~~pI+@example.com>
> >        --------+--------------
> >                |
> >                +-- This is the "file ID" part of the xBin-ID.
> >                    This is what you can cut-and past, or pass to
> >                    someone to specify what "xBin file" you want to get
> >                    from Usenet. A full xBin File-ID would be
> >                    ~XB~H...~S...~~
> >
> >        ------------------+------------------
> >                          + This is what I call the xBin-ID (~XB~ to ~~)
> >
> >       ---------------------------+--------------------------
> >                                  + The Message-ID (< to > of course)
>
> do you really think the size needs to be part of the file ID?  it
> could be useful since it allows the client to say "you have a total of
> 594 MiB on your wishlist", but it's not strictly necessary.

It's a matter of hash bits.  If you decide you need N hash bits to get the
probability of collision low enough, then it's best to use only "good" hash
bits.  However, the file size can act as "additional" hash bits.  Because
the distribtuion of the values are not even across all files (many will
have the same size, or have a size which is a multiple of some constant),
the bits aren't "good" hash bits.  But in the Message-ID, we want to not
include the full 120 we have in the SHA1 hash to keep the very limited
Message-ID "real estate" from being too abused.  And, the size needs to be
there already, so it can act as "free" hash bits to help us either reduce
the number of SHA1 bits in the Message-Id, or just make it that much
stronger.  It seems it would be a waste to not encourge people to use it.
If the hash in the Message-Id was long enough that we didn't need to use
the size, then we are wasting Message-ID characters and should remove some
from the hash.

> >   >   o   offset.  the first octet of this fragment is the octet at
> >   >   OFFSET
> >   >       of the complete file.  defaults to 0.
> >   >
> >   >   s   part size.  the size of this fragment in octets.  defaults to
> >   >       total size minus offset.
> >
> >   I had switched to using hash-block numbers here instead of bytes.
> >   Did you switch back to bytes for a reason?
>
> yes, with file sets the offsets of the second file in the file would
> usually not be block aligned.  I'll drop the file set concept, so I
> can change this back.  if we make s be in blocks, it must be left out
> for the last part, but that's just fine :-)

That would work.  I just thought of it as a value which defined the number
of "blocks" (full or partial) in the article, so even for the last aricle
it was still valid.  It just meant that the you needed to look at the size
if you wanted to find the "real" size of the data in bytes.  It might be
better to just have the size defualt to "the rest of the file" and leave it
out of the Message-ID for the last article.

> >   What would be useful in the Message-ID for this set file idea is a
> >   single paramater to define the type of the file (a very simple
> >   content-type idea).
> >
> >   Maybe ~T for type where it defaulted to 0 for "data file", and a
> >   value of 1 means it is an xBin set file[Format TBD].
>
> culling from other parts of the thread, it seems like we need at least
> three values:
>
>   data
>   announcing set
>   wanted set
>
> we could require the client to download all the set definitions to see
> if it is a wanted or an announcement, though.

Yeah, but if you have something like ~T1 already to mean "set" it seems a
shame not to allow ~T2 for "wanted set".  Thought it feels like there might
be reasons to only have "one" type for a "set" file and put the "wanting"
vs "annoucning" info in the file.  I'm not sure why I'm thinking that
however.

> >   We would not attempt to let this exapand into a mini mine
> >   Content-Type by creating values for text/plan, etc. The idea is to
> >   limit this to ONLY the basic types the download tools need to know
> >   about for getting their job done.
>
> definitely.
>
> >   > other headers
> >   > =============
> >   >
> >   > xBin posters should put all meta-data about the files in suitable
> >   > headers.
> >   >
> >   > filename (mandatory):
> >   >   Content-Disposition: attachment; filename="somefile.mp3"
> >   >
> >   > filetype (optional for single files):
> >   >   Content-Type: audio/mpeg
> >   >
> >   > fragment information (mandatory for file sets):
> >   >   Content-Type: message/fragment; offset=OCTETS; total-size=OCTETS
> >   >
> >   > these are MIME headers, but the article should not declare
> >   > "MIME-Version: 1.0" unless it is a well formed MIME document.
> >
> >   I'm not sure about all this.
> >
> >   You can't put this stuff in the article header if you have a mime
> >   multipart/mixed article with the data in the second part.  The
> >   file info headers in that case must be in the article body with
> >   the other headers for that second of the MIME article.
>
> yeah, it is a bit ugly.  removing the file sets helps heaps.
>
> >   > interaction with uuencode
> >   > =========================
> >   >
> >   > existing decoders will depend on meta-information in Subject, and
> >   > therefore an xBin aware poster SHOULD follow existing conventions
> >   > for tagging multipart files in Subject.  an xBin aware reader MUST
> >   > NOT rely on data in Subject.
> >
> >   We should add a little bit of the basics here about standard
> >   Subject conventions.  Such as documenting "(XX/YY)" and point out
> >   the the number of digits in both should be the same to make it
> >   sort correctly and that the "real" XX/YY must be the rightmost
> >   XX/YY on the line.  The wording should just document common
> >   practice to gude people and not attempt to create a standard.
>
> feel free to help out, I haven't studied that.  what's the difference
> between [XX/YY] and (XX/YY), for instance?  how much of the Subject
> must be kept constant?

Everything must be constant except the last XX/YY in the article. [] are
allowed though () is more common.

> >   > interaction with yEnc
> >   > =====================
> >   >
> >   > same issues as uuencode.  an xBin reader MUST NOT rely on
> >   > information from the =ybegin line.  an xBin poster MUST include
> >   > valid information in =ybegin.
> >
> >   It needs to get the file name from there hecause I don't think
> >   your Content-Dispostion idea is going to fly.
>
> why not?  we can just mandate it.  the nice thing about using
> Content-Disposition is that stuff like the character set issue has
> been sorted out (RFC 2231).

Because you can now have a multiplart/mixed MIME article with the first
part being text/plain and the second holding the data. Putting
Content-Dispostion in the header of all articles would break these types of
MIME articles which currently work.

> >   If you post a multipart file in a MIME format, it's got to be
> >   readable by mime-aware newsreaders.  If we can not post it in this
> >   format today, I don't see how we could ever justify posting it in
> >   that format (or why we would even bother trying to convert to it
> >   in the future).
>
> yeah.  I'll forget about that, and rather push for a
> message/external-body access-type if xBin actually gets deployed.
> (are you calling _me_ a weathervane? ;-)

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20030207234048.235$SM@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!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <1rvg0ehvar.fsf@vingodur.ifi.uio.no> <20030203033140.853$4N@newsreader.com> <1r3cn3pnx1.fsf@vingodur.ifi.uio.no>

Show Full Headers
Complete Article Headers
Message-ID: <20030207234048.235$SM@newsreader.com>
Subject: Re: xBin Message-ID convention
Date: Sat, 08 Feb 2003 04:40:48 +0000
From: curt@kcwc.com (Curt Welch)
References: <1rvg0ehvar.fsf@vingodur.ifi.uio.no> <20030203033140.853$4N@newsreader.com> <1r3cn3pnx1.fsf@vingodur.ifi.uio.no>
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!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com TpGpKqwZyh@KLpge8HLZm-fnPH.uJNwM+fcfRAlxJmrxkXr
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: 285