Subject: [xmpp] #66: indicating maximum stanza size

From: "xmpp issue tracker" <[email-masked]>
Date: Tue, 22 Jun 2010 02:08:08 -0000

#66: indicating maximum stanza size
--------------------------------+-------------------------------------------
 Reporter:  stpeter@…           |       Owner:  stpeter@…         
     Type:  defect              |      Status:  new               
 Priority:  minor               |   Milestone:                    
Component:  3920bis             |     Version:                    
 Severity:  In WG Last Call     |    Keywords:                    
--------------------------------+-------------------------------------------
 Section 8.5 (Stanza Size) states:

 > If an entity receives a stanza that exceeds its maximum stanza
 > size, it MUST return a <not-acceptable/> stanza error.

 Ben Campbell commented: "Is there a way to indicate the size limit in the
 error, so the sender can correct its behavior?"

-- 
Ticket URL: <http://trac.tools.ietf.org/wg/xmpp/trac/ticket/66>
xmpp <http://tools.ietf.org/xmpp/>

---

From: "xmpp issue tracker" <[email-masked]>
Date: Tue, 22 Jun 2010 02:12:59 -0000

Comment(by stpeter@…):

 Matthew Wild also commented: "At some point a XEP to help clients discover
 maximum stanza size would help greatly. Actually after reading further it
 seems this is already suggested in section 13.12, point 5. This section
 should probably be amended."

-- 
Ticket URL: <http://trac.tools.ietf.org/wg/xmpp/trac/ticket/66#comment:1>
xmpp <http://tools.ietf.org/xmpp/>

---

From: "xmpp issue tracker" <[email-masked]>
Date: Thu, 24 Jun 2010 01:22:40 -0000

#66: indicating maximum stanza size
--------------------------------+-------------------------------------------
 Reporter:  stpeter@…           |        Owner:  stpeter@…         
     Type:  defect              |       Status:  closed            
 Priority:  minor               |    Milestone:                    
Component:  3920bis             |      Version:                    
 Severity:  In WG Last Call     |   Resolution:  fixed             
 Keywords:                      |  
--------------------------------+-------------------------------------------
Changes (by stpeter@…):

  * status:  new => closed
  * resolution:  => fixed

Comment:

 Provisionally fixed with this text:

    XMPP is optimized for the exchange of relatively large numbers of
    relatively small stanzas.  A client or server MAY enforce a maximum
    stanza size (where "size" is inclusive of all XML markup as defined
    in Section 2.4 of [XML]).  The maximum stanza size SHOULD NOT be
    smaller than 65536 bytes, from the opening "<" character to the
    closing ">" character.  If an entity receives a stanza that exceeds
    its maximum stanza size, it MUST either return a <policy-violation/>
    stanza error (thus allowing the sender to recover) or close the
    stream with a <policy-violation/> stream error.  The maximum stanza
    size acceptable to a remote entity SHOULD be assumed to be 65536
    bytes unless known to be otherwise.

-- 
Ticket URL: <http://trac.tools.ietf.org/wg/xmpp/trac/ticket/66#comment:2>
xmpp <http://tools.ietf.org/xmpp/>

---

From: Kevin Smith <[email-masked]>
Date: Thu, 24 Jun 2010 07:32:58 +0100

>    bytes unless known to be otherwise.

What's the rationale for limiting stanzas to 64k? - this seems an
artificial choice. It also seems unworkable - a client can send a 64k
presence stanza to the server, and then the server not be able to pass
it on because it's over the 64k limit (and the same effect for MUC,
and pubsub etc). You'll get very strange effects if you send a stanza
that's close to 64k, with it being possible to be delivered to people
with short JIDs/Resources but not others etc.

Given that implementing a maximum stanza size is entirely optional,
and if you do implement one when you apply it and how large it is are
also optional, it doesn't seem appropriate to assume that everyone on
the network has one, and that they're all the same size.

I'd suggest reverting this.

/K

---

From: Bruce Campbell <[email-masked]>
Date: Thu, 24 Jun 2010 12:05:06 -0700

> with short JIDs/Resources but not others etc.

Since most of these cases involve forwarding entities modifying the stanza 
to include 'from' and 'to' attributes (each of which could be 3071 bytes), 
some sort of note to implementers would be best, eg:

    ... The maximum stanza size acceptable to a remote entity SHOULD be
    assumed to be 65536 bytes unless known to be otherwise.  Implementers
    are advised that additional processing and forwarding of the stanza may
    be done by other entities, which may further increase the size of the
    stanza (for example, adding in the originating and destination JIDs,
    each a possible 3071 bytes).  As such, implementations originating
    stanzas, where practical, SHOULD NOT send stanzas larger than 10k below
    the known maximum receivable size (eg, 55295 bytes).

This also covers cases where various implementations have differing ideas 
about where to count the size of stanzas; as it is received from the TCP 
socket and before the XML parser gets hold of it, or after the XML parser 
has silently removed extranous whitespace, mangled \015\012 etc.

-- 
   Bruce.

---

From: Kevin Smith <[email-masked]>
Date: Fri, 25 Jun 2010 08:35:08 +0100

> has silently removed extranous whitespace, mangled \015\012 etc.

I think we've reached agreement in the other thread to reword this
section anyway, as this maximum assumption of remote entities isn't
worthwhile.

/K