Skip to content

Single-byte character set #95 #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions v2-0-RC2/doc/00Contents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Contents
========

[Title](00Title.md)

[1. Introduction](01Introduction.md)

[2. Field Encoding](02FieldEncoding.md)

[3. Message Structure](03MessageStructure.md)

[4. Message Schema](04MessageSchema.md)

[5. Schema Extension Mechanism](05SchemaExtensionMechanism.md)

[6. Usage Guidelines](06UsageGuidelines.md)

[7. Examples](07Examples.md)

[8. Release Notes](08ReleaseNotes.md)
20 changes: 20 additions & 0 deletions v2-0-RC2/doc/00Title.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
![](./media/image1.jpeg)

FIX Simple Binary Encoding
==========================

## Technical Specification

Version 2.0 Release Candidate 2

**THIS DOCUMENT IS A RELEASE CANDIDATE FOR A PROPOSED FIX TECHNICAL
STANDARD. A RELEASE CANDIDATE HAS BEEN APPROVED BY THE GLOBAL TECHNICAL
COMMITTEE AS AN INITIAL STEP IN CREATING A NEW FIX TECHNICAL STANDARD.
POTENTIAL ADOPTERS ARE STRONGLY ENCOURAGED TO BEGIN WORKING WITH THE
RELEASE CANDIDATE AND TO PROVIDE FEEDBACK TO THE GLOBAL TECHNICAL
COMMITTEE AND THE WORKING GROUP THAT SUBMITTED THE PROPOSAL. THE
FEEDBACK TO THE RELEASE CANDIDATE WILL DETERMINE IF ANOTHER REVISION AND
RELEASE CANDIDATE IS NECESSARY OR IF THE RELEASE CANDIDATE CAN BE
PROMOTED TO BECOME A FIX TECHNICAL STANDARD DRAFT.**

**© Copyright 2015-2019 FIX Protocol Limited**
194 changes: 194 additions & 0 deletions v2-0-RC2/doc/01Introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
Introduction
=========================================================================================================================================================

FIX Simple Binary Encoding (SBE) targets high performance trading
systems. It is optimized for low latency of encoding and decoding while
keeping bandwidth utilization reasonably small. For compatibility, it is
intended to represent all FIX semantics.

This encoding specification describes the wire protocol for messages.
Thus, it provides a standard for interoperability between communicating
parties. Users are free to implement the standard in a way that best
suits their needs. Implementers may use the most appropriate techniques and idioms of programming languages to access data off the wire and manipulate it in applications.

The encoding standard is complimentary to other FIX standards for
session protocol and application level behavior.

Binary type system
----------------------------------------------------------------------------------------------------------------

In order to support traditional FIX semantics, all the documented field
types are supported. However, instead of printable character
representations of tag-value encoding, the type system binds to native
binary data types, and defines derived types as needed.

The binary type system has been enhanced in these ways:

- Provides a means to specify precision of decimal numbers and
timestamps, as well as valid ranges of numbers.

- Differentiates fixed-length character arrays from variable-length
strings. Allows a way to specify the minimum and maximum length of
strings that an application can accept.

- Provides a consistent system of enumerations, Boolean switches and
multiple-choice fields.

Design principles
---------------------------------------------------------------------------------------------------------------

The message design strives for direct data access without complex
transformations or conditional logic. This is achieved by:

- Usage of native binary data types and simple types derived from
native binaries, such as prices and timestamps.

- Preference for fixed positions and fixed length fields, supporting
direct access to data and avoiding the need for management of heaps
of variable-length elements which must be sequentially processed.

Message schema
------------------------------------------------------------------------------------------------------------

This standard describes how fields are encoded and the general structure
of messages. The content of a message type is specified by a message
schema. A message schema tells which fields belong to a message and
their location within a message. Additionally, the metadata describes
valid value ranges and information that need not be sent on the wire,
such as constant values.

Message schemas may be based on standard FIX message specifications, or
may be customized as needed by agreement between counterparties.

Glossary
------------------------------------------------------------------------------------------------------

**Character set** - A mapping between a sequence of octets and a sequence of characters.

**Data type** - A field type with its associated encoding attributes,
including backing primitive types and valid values or range. Some types
have additional attributes, e.g. epoch of a date.

**Encoding** - a message format for interchange. The term is commonly used
to mean the conversion of one data format to another, such as text to
binary. However, Simple Binary Encoding strives to use native binary
data types in order to make conversion unnecessary, or at least trivial.
Encoding also refers to the act of formatting a message, as opposed to
decoding.

**Message schema** - metadata that specifies messages and their data
types and identifiers. Message schemas may be disseminated out of band.
For Simple Binary Encoding, message schemas are expressed as an XML
document that conforms to an XML schema that is published as part of
this standard.

**Message template** - metadata that specifies the fields that belong to
one particular message type. A message template is contained by a
message schema.

**Session protocol** - a protocol concerned with the reliable delivery of
messages over a transport. FIX protocol makes a distinction between
session protocol and the encoding of a message payload, as described by
this document. See the specifications section of FIX protocol web site
for supported protocols. The original FIX session protocol is known as
FIXT.

**XML schema** - defines the elements and attributes that may appear in an
XML document. The SBE message schema is defined in W3C (XSD) schema
language since it is the most widely adopted format for XML schemas.

Documentation
-----------------------------------------------------------------------------------------------------------

This document explains:

- The binary type system for field encoding

- Message structure, including field arrangement, repeating groups,
and relationship to a message header that may be provided by a
session protocol.

- The Simple Binary Encoding message schema.

### Specification terms

These key words in this document are to be interpreted as described in
[Internet Engineering Task Force RFC2119](http://www.apps.ietf.org/rfc/rfc2119.html). These terms indicate
an absolute requirement for implementations of the standard: "**must**",
or "**required**".

This term indicates an absolute prohibition: "**must not**".

These terms indicate that a feature is allowed by the standard but not
required: "**may**", "**optional**". An implementation that does not
provide an optional feature must be prepared to interoperate with one
that does.

These terms give guidance, recommendation or best practices:
"**should**" or "**recommended**". A recommended choice among
alternatives is described as "**preferred**".

These terms give guidance that a practice is not recommended: "**should not**"
or "**not recommended**".

### Document format

In this document, these formats are used for technical specifications
and data examples.

This is a sample encoding specification

```xml
<type name="short" primitiveType="int16"/>
```

This is sample data as it would be transmitted on the wire

`10270000`

References
-------------------------------------------------------------------------------------------------------------------------------------------------------

### Related FIX Standards

[Simple Open Framing Header](https://www.fixtrading.org/packages/fix-simple-open-framing-header-draft-standard-1-0)
FIX Protocol, Limited. Version 1.0 Draft Standard

[FIX 5.0 Service Pack 2](https://www.fixtrading.org/standards/fix-5-0-sp-2/)
FIX semantics with Extension Packs.

### Dependencies on other standards

SBE is dependent on several industry standards. Implementations must
conform to these standards to interoperate. Therefore, they are
normative for SBE.

[IEEE 754-2008](http://ieeexplore.ieee.org/servlet/opac?punumber=4610933) A
Standard for Binary Floating-Point Arithmetic

[IETF RFC 2978](https://tools.ietf.org/html/rfc2978)
IANA Charset Registration Procedures. See [Character Sets](https://www.iana.org/assignments/character-sets/character-sets.xml)

[ISO 639-1:2002](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=22109)
Codes for the representation of names of languages - Part 1: Alpha-2
code

[ISO 3166-1:2013](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=63545)
Codes for the representation of names of countries and their
subdivisions - Part 1: Country codes

[ISO 4217:2015](https://www.iso.org/standard/64758.html)
Codes for the representation of currencies and funds

[ISO 8601:2004](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=40874)
Data elements and interchange formats - Information interchange -
Representation of dates and times

[ISO/IEC 8859-1:1998](https://www.iso.org/standard/28245.html)
8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1

[ISO 10383:2012](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=61067)
Securities and related financial instruments - Codes for exchanges and
market identification (MIC)

[W3C XML Schema version 1.1](https://www.w3.org/TR/2006/REC-xml11-20060816/)
Loading