21-05-0407-03-0000 ieee 802.21 media independent handover dcn:21-05-0407-03-0000 title: integration...
TRANSCRIPT
21-05-0407-03-0000
• IEEE 802.21 MEDIA INDEPENDENT HANDOVER
• DCN:21-05-0407-03-0000
• Title: Integration of XML and TLV
• Date Submitted: January, 9, 2006
• Presented at IEEE 802.21 session in Vancouver
• Authors or Source(s):
• Yoshihiro Ohba, Kenichi Taniuchi and Subir Das
• Abstract: This document describes two methods for converting XML 1.0 data to TLV format. The two methods and XML 1.0 are compared in terms of number of encoded octets and processing time for three typical query types.
21-05-0407-03-0000
IEEE 802.21 presentation release statements
• This document has been prepared to assist the IEEE 802.21 Working Group. It is offered as a basis for discussion and is not binding on the contributing individual(s) or organization(s). The material in this document is subject to change in form and content after further study. The contributor(s) reserve(s) the right to add, amend or withdraw material contained herein.
• The contributor grants a free, irrevocable license to the IEEE to incorporate material contained in this contribution, and any modifications thereof, in the creation of an IEEE Standards publication; to copyright in the IEEE’s name any IEEE Standards publication even though it may include portions of this contribution; and at the IEEE’s sole discretion to permit others to reproduce in whole or in part the resulting IEEE Standards publication. The contributor also acknowledges and accepts that this contribution may be made public by IEEE 802.21.
• The contributor is familiar with IEEE patent policy, as outlined in Section 6.3 of the IEEE-SA Standards Board Operations Manual <http://standards.ieee.org/guides/opman/sect6.html#6.3> and in Understanding Patent Issues During IEEE Standards Development http://standards.ieee.org/board/pat/guide.html>
21-05-0407-03-0000
Information Service Properties
• Information Service representation and Information query/exchange shall be
• Extensible: • The specification shall be able to support future PHY/MAC
technology, without changing the 802.21 specification itself every time a new PHY/MAC technology is invented
• Flexible: • The specification shall be able to support various types of queries to
be useful for different handover mechanisms, protocols, algorithms and policies.
• Efficient:• The specification shall avoid unnecessary information
query/exchange and should have less information encoding overhead
21-05-0407-03-0000
A Possible Approach
• Schema-based semantic query with binary encoding
• Schema provides extensibility
• Semantic query provides flexibility and query efficiency
• Binary encoding provides encoding efficiency
How can we achieve all of above functionalities?
It is evident that only by integrating XML and TLV, we can
achieve best of each solution
21-05-0407-03-0000
Candidate Solutions
• XML provides schema-based semantic query • But needs to send more bits over the air if we use native XML 1.0
format
• TLV provides binary encoding• But does not provide a standard query language for semantic query
It is evident that only by integrating XML and TLV, we can achieve best of each solution
21-05-0407-03-0000
How Can We integrate?• Possible approach : XML binary representation
• Convert XML data contained in query result into TLV• Two example conversion methods
• Method A: Applicable to any XML data• Alias-based conversion
• Convert XML namespace names to integers• Convert XML tag names to integers• Convert XML attribute names to integers• Convert ENTRY names to integers
• Dynamic integer mapping• Mappings are carried with data
• Method B: Applicable to a particular query language• Semantic bundling
• Two or more semantically -related XML tags are mapped to a single integer for further optimization• Taking advantage of the knowledge of the query language syntax
• Apply Method A for other operations
21-05-0407-03-0000
TLV Format for XML binary encoding
0x1= STR
0x2= XMLVER
0x3 = DOCTYPE0x4 = ENTDEF0x5 = DOC0x6 = NSDEF 0x7 = BASE0x8 = TAGDEF0x9 = ATRDEF0xa = ENT0xb = NS0xc = TAG0xd = ATR0xe = STRALDEF
Type Length Value
Octets: 1 2 Variable
0xf = STRAL0x10 = YES0x11 = NO0x12 = BLANKNODE0x13 = RDFTRIPLES0x14 = VARIABLE0x15 = RESULT…
Type field values
21-05-0407-03-0000
STR TLV
• Value field contains an octet string
Octets:
Octet String
Variable
Length0x1
21
21-05-0407-03-0000
STRALDEF TLV
• Value field: String Alias Number and Octet String
String Alias Number
Octets: 2
Octet String
Variable
Length0xe
21
21-05-0407-03-0000
XMLVER TLV• Corresponds to <?xml version=“…”> tag
• Value field contains the version string
• In case of <?xml version=“1.0”>, XMLVER TLV can be omitted
Octet String
Octets: 2
Length0x2
21
21-05-0407-03-0000
DOCTYPE TLV
• Corresponds to <!DOCTYPE document_type> commentary tag
• Value field contains the document_type string
STR TLV
Octets: 2
Length0x3
21
21-05-0407-03-0000
ENTDEF TLV
• Corresponds to “<!ENTRY entry_name entry_value>”
EntryNumber
STR TLV (Entry name)
Octets: 2 Variable
STR TLV (Entry value)
Variable
Length0x4
21
21-05-0407-03-0000
DOC TLV
• Corresponds to the first non-commentary tag
List of NSDEF TLVs(option)
BASE Value(Octet String)
Octets: VariableVariable
Length0x5
21
21-05-0407-03-0000
NSDEF TLV
• Corresponds to “xmlns:namespace_name” attribute
NSNumber
STR TLV(NS name [Optional])
Octets: 2 Variable
STR TLV or ENT TLV(NS value)
Variable
Length0x6
21
21-05-0407-03-0000
BASE TLV
• Corresponds to “xmln:base” attribute
Octets:
STR TLV or ENT TLV
Variable
Length0x7
21
21-05-0407-03-0000
TAGDEF TLV
• Corresponds to the non-commentary tags except for the first one
TagNumber
Octets: 2
Tag Name(Octet String)
Variable2
NS Number
If there is no explicit namespece, then NS Number value is 0 (zero)
Length0x8
21
21-05-0407-03-0000
Predefined Tag Numbers (1..999)
• sparql= 1
• head = 2
• variable = 3
• results = 4
• result = 5
• binding = 6
• literal = 7
• boolean = 8
TAGDEF TLV is not needed for the above tags
21-05-0407-03-0000
TAG TLV
• Corresponds to a non-commentary tag
TagNumber
Octets: 2
Zero or more ATR TLVs
Variable
Zero or more TAG TLVs or TAGDEFs or
ATRDEFs or STR TLV or STRAL TLV [OPTIONAL]
Variable
Length0xc
21
21-05-0407-03-0000
ATRDEF TLV
• Corresponds to an attribute_name=attribute_value part in tag
AttributeNumber
Octets: 2
Attribute Name(Octet String)
Variable
Length0x9
21
21-05-0407-03-0000
Predefined Attribute Numbers (1..999)
• name = 1
• datatype = 2
• ordered = 3
• distince = 4
ATRDEF TLV is not needed for the above attribute numbers
21-05-0407-03-0000
ATR TLV
• Corresponds to an attribute_name=attribute_value part in tag
AttributeNumber
Octets: 2
STR TLV orSTRAL TLV
Variable2
Entry Number
If there is no explicit entry, then Entry Number value is 0 (zero)
Length0xd
21
21-05-0407-03-0000
Type of query used in XML
• XML-based query language, e.g., SPARQL, has three types query:
• Construction query: used for sub-graph fetch• RDF triples are returned
• Selection query: used for selected bindings• pairs of variable names and values are returned
• Boolean query: Used for binary answer• “yes” or “no” is returned
21-05-0407-03-0000
Example of a Construction query
• Query for obtaining IEs of a neighboring PoA
PREFIX mihbase: <http://www.mih.org/>CONSTRUCT ?s ?p ?oWHERE { GRAPH ?g1{ ?s ?p ?o ?x mihbase:poa ?poa. ?poa mihbase:poa-type 19 . ?poa mihbase:poa-id “aabbccddeeff” . }}
21-05-0407-03-0000
Construction query result• Query result in XML 1.0 (1198 Bytes)
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [ <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#"> <!ENTITY mihbase "http://www.mih.org/basic-schema#"> <!ENTITY base "http://mediaindependentinformationserver.org/" >
]><rdf:RDF xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:mihbase="&mihbase;" xml:base="&base;">
<rdf:Description rdf:about="&base;network2"> <rdf:type rdf:resource="&mihbase;Network"/> <mihbase:mdi> <rdf:Description> <mihbase:data-rate>54000</mihbase:data-rate> </rdf:Description>
• Query result in XML binary in TLV (680 Bytes)
[0x3][229][ [0x1][7]["rdf:RDF"] [0x4][54][1][ [0x1][3]["rdf"] [0x1][43]["http://www.w3.org/1999/02/22-rdf-syntax-ns#"] ] [0x4][49][2][ [0x1][4]["rdfs"] [0x1][37]["http://www.w3.org/2000/01/rdf-schema#"] ] [0x4][47][3][ [0x1][7]["mihbase"] [0x1][32]["http://www.mih.org/basic-schema#"] ] [0x4][57][4][ [0x1][4]["base"] [0x1][45]["http://mediaindependentinformationserver.org/"] ] ][0x5][61] [ [0x6][13][1][ [0x1][3]["rdf"] [0xa][2][1] ] [0x6][14][2][ [0x1][4]["rdfs"] [0xa][2][2]] [0x6][17][3][ [0x1][7]["mihbase"] [0xa][2][3]] [0x7][5][ [0xa][2][4]]]][0x8][15][1000][1]["Description"][0x9][9][1000][1]["about"]
21-05-0407-03-0000
</mihbase:mdi> <mihbase:mii> <rdf:Description> <mihbase:poa> <rdf:Description> <mihbase:poa-type>19</mihbase:poa-type> <mihbase:poa-id>aabbccddeeff</mihbase:poa-id> </rdf:Description> </mihbase:poa> <mihbase:neighboring-poa> <rdf:Description> <mihbase:poa-type>19</mihbase:poa-type> <mihbase:poa-id>112233445566</mihbase:poa-id> </rdf:Description> </mihbase:neighboring-poa> <mihbase:neighboring-poa> <rdf:Description> <mihbase:poa-type>19</mihbase:poa-type> <mihbase:poa-id>0123456789ab</mihbase:poa-id> </rdf:Description> </mihbase:neighboring-poa> </rdf:Description> </mihbase:mii></rdf:Description>
</rdf:RDF>
[0xc][310][1000][ [0xd][15][1][ [0xa][2][4]["network2"] ] [0x8][8][1001][1]["type"] [0x9][12][1001][1]["resource"] [0xc][16][1001][ [0xd][11][1001][3]["Network"] ] [0x8][7][1002][3]["mdi"] [0xc][37][1002][ [0xc][32][1000][ [0x8][14][1003][0x1][9]["data-rate"] [0xc][10][1003][0x1][5][“54000”] ] ] [0x8][7][1004][3]["mii"] [0xc][182][1004][ [0xc][177][1000][ [0x8][7][1005][3]["poa"] [0xc][60][1000][ [0x8][12][1006][3]["poa-type"] [0xc][7][1006][0x1][2][“19”] [0x8][10][1007][3]["poa-id"] [0xc][17][1007][0x1][12]["aabbccddeeff"] ] [0x8][19][1008][3]["neighboring-poa"] [0xc][37][1008][ [0xc][32][1000][ [0xc][7][1006][0x1][2][“19”] [0xc][17][1007][0x1][12]["112233445566"] ] ] [0xc][37][1008][ [0xc][32][1000][ [0xc][7][1006][0x1][2][“19”] [0xc][17][1007][0x1][12]["0123456789ab"] ] ] ] ] ]
21-05-0407-03-0000
Example of a Selection query• Query for obtaining neighboring PoA
PREFIX mihbase: <http://www.mih.org/>SELECT ?poa-idWHERE { ?mii mihbase:poa ?poa . ?poa mihbase:poa-id 123456789abc . ?mii mihbase:neighboring-poa ?neighboring-poa . ?neighboring-poa mihbase:poa-id ?poa-id .}
21-05-0407-03-0000
Selection query result
<?xml version="1.0"?><sparql xmlns="http://www.w3.org/2005/sparql-results#"> <head> <variable name=”poa-id”/> </head> <results ordered=”false” distince=”false”> <result> <binding name=”poa-id”> <literal datatype="http://www.w3.org/2001/XMLSchema#hexBinary"> aabbccddeeff</literal></binding> </result> <result> <binding name=”poa-id”> <literal datatype=”http://www.w3.org/2001/XMLSchema#hexBinary”>112233445566</literal></binding> …….(more 8 poa-ids are written here) </rebult> </results></sparql >
[0xc][694][1][ [0x6][41][0][ [0x1][38]["http://www.w3.org/2005/sparqlresults#"]] [0xc][20][2][ [0xc][15][3][ [0x9][10][1][0]["poa-id"]]] [0xc][621][4][ [0x9][9][3][0]["false"][0x9][9][4][0]["false"] [0xc][97][5][ [0xc][15][6][ [0x9][10][1][0]["poa-id"]] [0xc][76][7][ [0xe][44][1][http://www.w3.org/2001/XMLSchema#hexBinary] [0x9][9][2][0][0xf][2][1] [0x1][12]["aabbccddeeff"]]] [0xc][52][5][ [0xc][15][6][ [0x9][10][1][0]["poa-id"]] [0xc][29][7][ [0x9][9][2][0][0xf][2][1] [0x1][12]["112233445566"]]]…(more 8 poa-ids are written here)]]
• Query result in XML 1.0 (1596 Bytes) • Query result in XML binary in TLV (694 Bytes)
21-05-0407-03-0000
Example of a Boolean query
• Query for asking if a neighboring PoA is 802.11
PREFIX mihbase: <http://www.mih.org/>
ASK {?poa mihbase:poa-type 19 ; ?poa mihbase:poa-id “aabbccddeeff” }
21-05-0407-03-0000
Boolean query result• Query result in XML 1.0 (153 Bytes)
<?xml version="1.0"?><sparql xmlns="http://www.w3.org/2005/06/sparqlResults"> <head></head> <results> <boolean>true</boolean> </results></sparql>
• Query result in XML binary in TLV (52 Bytes)
[0xc][49][1][0x6][44][1][0x1][39]["http://www.w3.org/2005/06/sparqlResults"] [0xc][2][2] [0xc][14][4] [0xc][9][8][0x1][4]["true"] ]
21-05-0407-03-0000
Comparison of the formats
52
694
680
153
1596
1198
0 500 1000 1500 2000
Boolean query
Selection query
Construction query
Number of encoded bytes
Method A XML 1.0
21-05-0407-03-0000
TLV Format for XML binary encoding
0x1= STR
0x2= XMLVER
0x3 = DOCTYPE0x4 = ENTDEF0x5 = DOC0x6 = NSDEF 0x7 = BASE0x8 = TAGDEF0x9 = ATRDEF0xa = ENT0xb = NS0xc = TAG0xd = ATR0xe = STRALDEF
Type Length Value
Octets: 1 2 Variable
0xf = STRAL0x10 = YES0x11 = NO0x12 = BLANKNODE0x13 = RDFTRIPLES0x14 = VARIABLE0x15 = RESULT…
Type field values
21-05-0407-03-0000
YES TLV
• Value field: NULL
• This TLV may be used for encoding result of “yes” for Boolean query of SPARQL.
• When this TLV is carried, other TLVs carried in the same query result can be omitted.
• Receiver which receives this TLV decodes it to an appropriate XML format for the corresponding SPARQL Query results.
Length(=0)0x10
21Octets:
21-05-0407-03-0000
NO TLV
• Value field: NULL
• This TLV may be used for encoding result of “no” for Boolean query of SPARQL.
• When this TLV is carried, other TLVs carried in the same query result can be omitted.
• Receiver which receives this TLV decodes it to an appropriate XML format for the corresponding SPARQL Query results.
Length(=0)0x11
21Octets:
21-05-0407-03-0000
RDFTRIPLES TLV
Length0x13
21Octets:
Zero or moreNS TLV (Optional)
(Subject)
Variable
BLANKNODE TLV orSTR TLV or
STRAL TLV (Subject)
Variable
Zero or moreNS TLV (Optional)
(Predicate)
Variable
BLANKNODE TLV orSTR TLV or
STRAL TLV (Predicate)
Variable
Zero or moreNS TLV (Optional)
(Object)
Variable
BLANKNODE TLV orSTR TLV or
STRAL TLV (Object)
Variable
21-05-0407-03-0000
RESULT TLV
Length0x15
21Octets:
NS TLV(OPTIONAL)
Variable
BLANKNODE TLV orSTR TLV or STRAL TLV
Variable
21-05-0407-03-0000
Construction query result with SPARQL optimization
• (SPARQL Query Results XML Format) 1198 Bytes
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [ <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#"> <!ENTITY mihbase "http://www.mih.org/basic-schema#"> <!ENTITY base "http://mediaindependentinformationserver.org/" >
]><rdf:RDF xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:mihbase="&mihbase;" xml:base="&base;">
<rdf:Description rdf:about="&base;network2"> <rdf:type rdf:resource="&mihbase;Network"/> <mihbase:mdi> <rdf:Description> <mihbase:data-rate>54000</mihbase:data-rate> </rdf:Description>
• (TLV) 587Bytes
[0x6][50][1][0x1][45]["http://mediaindependentinformationserver.org/"][0x6][37][2][0x1][32]["http://www.mih.org/basic-schema#"][0x6][48][3][0x1][43]["http://www.w3.org/1999/02/22-rdf-syntax-ns#"][0x13][43] [0xb][2][1][0x1][8]["network2"] [0xb][2][3][0x1][4]["type"] [0xb][2][2][0x1][7]["Network"] ][0x13][30] [0x12][2][1] [0xb][2][2][0x1][9]["data-rate"] [0x1][5]["54000"] ][0x13][32] [0xb][2][1][0x1][8]["network2"] [0xb][2][2][0x1][3]["mdi"] [0x12][2][1] ][0x13][26] [0x12][2][3] [0xb][2][2][0x1][8]["poa-type"] [0x1][2]["19"] ][0x13][34] [0x12][2][3] [0xb][2][2][0x1][6]["poa-id"] [0x1][12]["aabbccddeeff"] ]
21-05-0407-03-0000
</mihbase:mdi> <mihbase:mii> <rdf:Description> <mihbase:poa> <rdf:Description> <mihbase:poa-type>19</mihbase:poa-type> <mihbase:poa-id>aabbccddeeff</mihbase:poa-id> </rdf:Description> </mihbase:poa> <mihbase:neighboring-poa> <rdf:Description> <mihbase:poa-type>19</mihbase:poa-type> <mihbase:poa-id>112233445566</mihbase:poa-id> </rdf:Description> </mihbase:neighboring-poa> <mihbase:neighboring-poa> <rdf:Description> <mihbase:poa-type>19</mihbase:poa-type> <mihbase:poa-id>0123456789ab</mihbase:poa-id> </rdf:Description> </mihbase:neighboring-poa> </rdf:Description> </mihbase:mii></rdf:Description>
</rdf:RDF>
[0x13][21] [0x12][2][2] [0xb][2][2][0x1][3]["poa"] [0x12][2][3] ][0x13][26] [0x12][2][4] [0xb][2][2][0x1][8]["poa-type"] [0x1][2]["19"] ][0x13][34] [0x12][2][4] [0xb][2][2][0x1][6]["poa-id"] [0x1][12]["112233445566"] ][0x13][33] [0x12][2][2] [0xb][2][2][0x1][15]["neighboring-poa"] [0x12][2][4] ][0x13][26] [0x12][2][5] [0xb][2][2][0x1][8]["poa-type"] [0x1][2]["19"] ][0x13][34] [0x12][2][5] [0xb][2][2][0x1][6]["poa-id"] [0x1][12]["0123456789ab"] ][0x13][33] [0x12][2][2] [0xb][2][2][0x1][15]["neighboring-poa"] [0x12][2][5] ][0x13][32] [0xb][2][1][0x1][8]["network2"] [0xb][2][2][0x1][3]["mii"] [0x12][2][2] ]
21-05-0407-03-0000
Selection query result with SPARQL optimization
• (SPARQL Query Results XML Format) 1596 Bytes
<?xml version="1.0"?><sparql xmlns="http://www.w3.org/2005/sparql-results#"> <head> <variable name=”poa-id”/> </head> <results ordered=”false” distince=”false”> <result> <binding name=”poa-id”> <literal datatype="http://www.w3.org/2001/XMLSchema#hexBinary"> aabbccddeeff</literal></binding> </result> <result> <binding name=”poa-id”> <literal datatype=”http://www.w3.org/2001/XMLSchema#hexBinary”>112233445566</literal></binding> …….(more 8 poa-ids are written here) </rebult> </results></sparql >
• (TLV) 192Bytes
[0x14][9][0x1][6]["poa-id"][0x15][15][0x1][12]["aabbccddeeff"][0x15][15][0x1][12]["112233445566"].....(more 8 poa-ids are written here)
21-05-0407-03-0000
Boolean query result with SPARQL optimization
• (SPARQL Query Results XML Format) 153 Bytes
<?xml version="1.0"?><sparql xmlns="http://www.w3.org/2005/06/sparqlResults"> <head></head> <results> <boolean>true</boolean> </results></sparql>
• (TLV) 3Bytes
[0x10][0]
21-05-0407-03-0000
Comparison of the formats
3
192
587
153
1596
1198
0 500 1000 1500 2000
Boolean query
Selection query
Construction query
Number of encoded bytes
Method B XML 1.0
21-05-0407-03-0000
Comparison of the formats
150
290
413
3
192
587
52
694
680
153
1596
1198
0 500 1000 1500 2000
Boolean query
Selection query
Construction query
Number of encoded bytes
XML 1.0
Method A
Method B
gzip
21-05-0407-03-0000
Two types of conversions
XML DOM
InternalData
BinaryData
Direct Conversion
3-Step Conversion
21-05-0407-03-0000
Data conversion time measured on PDA (CPU: ARM 206MHz, OS: Linux)
Constuction Query
Method AMethod B
gunzip
Direct Conversion Binary(TLV) to Internal 7 TBD N/A
3Step Conversion
Binary to XML TBD TBD 15
XML to DOM 41 41 41
DOM to Internal 33 33 33
Total TBD TBD 89
21-05-0407-03-0000
Data conversion time for Method A measured on PC
Internal data: DOM (Document Object Model)CPU: Pentium-M 1.7GHzOS: Linux
•Construction queryInternal to XML : 1-2ms XML to TLV: 2-3ms
•Selection queryInternal to XML : 3ms XML to TLV: 3ms
•Boolean queryInternal to XML : 1ms XML to TLV: 2ms