Re: [apps-discuss] SenML

"Kaebisch, Sebastian" <sebastian.kaebisch.ext@siemens.com> Fri, 09 March 2012 15:06 UTC

Return-Path: <sebastian.kaebisch.ext@siemens.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8FEFD21F865D for <apps-discuss@ietfa.amsl.com>; Fri, 9 Mar 2012 07:06:02 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.249
X-Spam-Level:
X-Spam-Status: No, score=-10.249 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J6YlhJ2YyycD for <apps-discuss@ietfa.amsl.com>; Fri, 9 Mar 2012 07:06:01 -0800 (PST)
Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) by ietfa.amsl.com (Postfix) with ESMTP id 1DF7221F8637 for <apps-discuss@ietf.org>; Fri, 9 Mar 2012 07:05:55 -0800 (PST)
Received: from mail2.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id q29F5r2n009458; Fri, 9 Mar 2012 16:05:54 +0100
Received: from DEMCHP99ET2MSX.ww902.siemens.net (demchp99et2msx.ww902.siemens.net [139.25.131.241]) by mail2.siemens.de (8.13.6/8.13.6) with ESMTP id q29F5rSx026553 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 9 Mar 2012 16:05:53 +0100
Received: from DEMCHP99E55MSX.ww902.siemens.net ([169.254.2.75]) by DEMCHP99ET2MSX.ww902.siemens.net ([139.25.131.241]) with mapi; Fri, 9 Mar 2012 16:05:53 +0100
From: "Kaebisch, Sebastian" <sebastian.kaebisch.ext@siemens.com>
To: "apps-discuss@ietf.org" <apps-discuss@ietf.org>
Date: Fri, 09 Mar 2012 16:05:51 +0100
Thread-Topic: [apps-discuss] SenML
Thread-Index: Acz3sZ2pCXNfVFEuSEmU74JtLAYX1QGVAcIQ
Message-ID: <1CE2FB42E90B614C98BC172FAB12D4C002D50989C3@DEMCHP99E55MSX.ww902.siemens.net>
References: <1CE2FB42E90B614C98BC172FAB12D4C002D3FCFF8A@DEMCHP99E55MSX.ww902.siemens.net> <52B10DF8-11D1-44FE-8A8B-184BB0AE12F2@sensinode.com>
In-Reply-To: <52B10DF8-11D1-44FE-8A8B-184BB0AE12F2@sensinode.com>
Accept-Language: de-DE
Content-Language: de-DE
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: de-DE
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [apps-discuss] SenML
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Mar 2012 15:06:02 -0000

Hello all,

as I already announced last week I would like to provide some improvements of the SenML XSD that would optimize the EXI usage. 


My proposed (major) changes are:


1) change all typed based "integer" elements to "int". An "integer" in the XSD domain is much bigger as a "long". I assume, this was not the intention. 


2) instead of using a "float" value, I would recommend to use the "mantissa" and "exponend" representation. A floating value is always a challenge for constrained devices because of its inefficent processing.


3) use restriction definitions of strings (define maxLength or list all possible values as enumeration). Especially using enumerations results in a smaller message size and avoids string comparison. 


4) instead of using abbreviation of the element/attribute names I would define the full name which makes life easer, e.g., when it comes to debugging of SenML messages. This is one of the strength of EXI where the names of an element/attribute do not effect the EXI message size.


Further small proposals can be seen in the XSD below. 

I would be happy about any feedback. If you have any questions, please do not hesitate to contact me.

Best regards
Sebastian

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://tools.ietf.org/SenML"
    xmlns:senml="http://tools.ietf.org/SenML">

    <xs:element name="SenML">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Parameter" type="senml:ParameterType" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="ParameterType">
        <xs:sequence>
            <xs:element name="Name" type="senml:stringType" minOccurs="0"/>
            <xs:element name="Time" type="xs:int" minOccurs="0"/>
            <xs:element name="UpdateTime" type="xs:int" minOccurs="0"/>
            <xs:element name="Units" type="senml:unitType" minOccurs="0"/>
            <xs:element name="Value" type="senml:FloatValueType" minOccurs="0"/>
            <xs:element name="StringValue" type="senml:stringType" minOccurs="0"/>
            <xs:element name="BooleanValue" type="xs:boolean" minOccurs="0"/>
            <xs:element name="ValueSum" type="senml:FloatValueType" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="BaseName" type="senml:stringType"/>
        <xs:attribute name="BaseTime" type="xs:int" />
        <xs:attribute name="BaseUnits" type="senml:stringType" />
        <xs:attribute name="Version" type="xs:short" />
    </xs:complexType>
    
    <xs:complexType name="FloatValueType">
        <!-- floatValue = value * 10^Exponent -->
        <xs:sequence>
            <xs:element name="Value" type="xs:int"/>
            <xs:element name="Exponent" type="xs:byte"/>
        </xs:sequence>
    </xs:complexType>    
       
    <xs:simpleType name="stringType">
        <xs:restriction base="xs:string">
            <xs:maxLength value="16"/>
        </xs:restriction>
    </xs:simpleType>
    

    <xs:simpleType name="unitType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="m"/>
            <xs:enumeration value="kg"/>            
            <xs:enumeration value="s"/>
            <xs:enumeration value="A"/>
            <xs:enumeration value="K"/>
            <xs:enumeration value="cd"/>
            <xs:enumeration value="mol"/>            
            <xs:enumeration value="Hz"/>
            <xs:enumeration value="rad"/>
            <xs:enumeration value="sr"/>
            <xs:enumeration value="N"/>
            <xs:enumeration value="Pa"/>            
            <xs:enumeration value="J"/>
            <xs:enumeration value="W"/>
            <xs:enumeration value="C"/>
            <xs:enumeration value="V"/>
            <xs:enumeration value="F"/>            
            <xs:enumeration value="Ohm"/>
            <xs:enumeration value="S"/>
            <xs:enumeration value="Wb"/>
            <xs:enumeration value="T"/>
            <xs:enumeration value="H"/>            
            <xs:enumeration value="degC"/>
            <xs:enumeration value="lm"/>
            <xs:enumeration value="lx"/>
            <xs:enumeration value="Bq"/>
            <xs:enumeration value="Gy"/>            
            <xs:enumeration value="Sv"/>
            <xs:enumeration value="kat"/>
            <xs:enumeration value="pH"/>
            <xs:enumeration value="Percent"/>
            <xs:enumeration value="count"/>            
            <xs:enumeration value="Percent_RH"/>
            <xs:enumeration value="m2"/>
            <xs:enumeration value="l"/>
            <xs:enumeration value="m/s"/>
            <xs:enumeration value="m/s2"/>
            <xs:enumeration value="l/s"/>
            <xs:enumeration value="W/m2"/>
            <xs:enumeration value="cd/m2"/>
            <xs:enumeration value="Bspl"/>
            <xs:enumeration value="bit/s"/>
            <xs:enumeration value="lat"/>
            <xs:enumeration value="lon"/>
            <xs:enumeration value="Percent_EL"/>
        </xs:restriction>
    </xs:simpleType>

</xs:schema>
> -----Original Message-----
> From: Zach Shelby [mailto:zach@sensinode.com]
> Sent: Thursday, March 01, 2012 2:46 PM
> To: Kaebisch, Sebastian
> Cc: apps-discuss@ietf.org
> Subject: Re: [apps-discuss] SenML
> 
> Hi Sebastian,
> 
> Your suggestions for optimizing the XSD for EXI use would be very welcome.
> Looking forward to it!
> 
> Thanks,
> Zach
> 
> On Feb 29, 2012, at 6:26 PM, Kaebisch, Sebastian wrote:
> 
> >
> > Hi all,
> >
> > I have some improvement suggestions concerning the XSD which is used for
> senML EXI coding. Right now, there are some types defined which are not
> optimal for small embedded devices. E.g., attribute "t", "ut", and "ver"
> are typed as "integer". I think, "int" will be enough in that context.
> Furthermore, I would like to suggest to make some changes in the XSD
> definitions (e.g., using enumerations) to make the EXI message instances
> more compact. I will prepare an XSD proposal for the next week for further
> discussions.
> >
> > Best regards
> > Sebastian Käbisch
> >
> > _______________________________________________
> > apps-discuss mailing list
> > apps-discuss@ietf.org
> > https://www.ietf.org/mailman/listinfo/apps-discuss
> 
> --
> Zach Shelby, Chief Nerd, Sensinode Ltd.
> http://www.sensinode.com
> http://zachshelby.org  - My blog "On the Internet of Things"
> http://6lowpan.net - My book "6LoWPAN: The Wireless Embedded Internet"
> Mobile: +358 40 7796297