Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
As a common language, any device should be able to synchronize with any SyncML service
(a networked data repository).
Any service speaking SyncML should be able to synchronize with any SyncML-capable
device.
The protocol must address the limitations of mobile devices, specifically with respect to
memory storage.
1
It must support a variety of transport protocols such as HTTP, SMTP, Bluetooth and others.
Support asynchronous communication and error-handling, since the Internet has latency.
SyncML PROTOCOLS
The SyncML programming framework is based on two protocols: SyncML Representation
protocol and SyncML Synchronization protocol. The SyncML Representation protocol defines
the representation format of SyncML messages (in XML) and details the inner workings of the
SyncML framework.
The SyncML Synchronization protocol defines the actions between a SyncML client and a
SyncML server. In order to build a SyncML-compliant product, you must adhere to the
requirements of these two protocols.
The important components of the SyncML protocol are:
1. Change log
Being a synchronization protocol, SyncML requires that both client and server maintain
information about changes or modifications (i.e., replacement, addition, deletion of data) to the
data in their databases. The mechanism by which this information is tracked is called a change
log. SyncML does not specify the format of the change log; however, upon synchronization each
device must be able to specify the data items that have changed since the previous
synchronization.
2. Map operation
SyncML is based on the principle that the client and the server may each have their own unique
identifiers (IDs) for items in their databases. The client ID is known as a locally unique identifier
(LUID); the server ID is known as a globally unique identifier (GUID). These IDs may or may
not be congruent between client and server.
Because the IDs can be different, the server must maintain an ID mapping table for all items
exchanged between itself and the client. That is, the server must know which client IDs and
which server IDs point to the same data item. LUIDs are always assigned by the client device.
This means that even if the server adds an item to the client device, the client will assign the
LUID for that item. The client will then use the Map operation to send the LUID of the new item
to the server. Following the Map operation, the server will update its mapping table with the
client LUID.
3. Sync anchors
The two sync anchors, Last and Next, are always sent when a synchronization session is
initialized. The Last sync anchor describes the last synchronization event from the point of the
sending device; the Next sync anchor describes the current event of synchronization from the
point of the sending device. In this way, the client and the server send sync anchors to each
other. Upon receiving a Next sync anchor, the receiving device must store it until the next
synchronization. Upon the next synchronization, the receiving device will compare its stored
sync anchors with the sending device's Last sync anchor, to determine whether any failures have
occurred in the sending device's data. If the Last and Next sync anchors match, the receiving
device concludes that no failures have occurred. If they don't match, the device can request an
appropriate action from the other device, such as a slow sync. The stored sync anchor is updated
only when the session has ended successfully.
4. Conflict resolution
A version conflict generally arises when a single data item is modified on both the client and the
server database, resulting in two different versions of the same data. A synchronization protocol
must have a policy for resolving such conflicts. In the SyncML, conflict resolution is a function
of the sync engine. Generally, the SyncML server's sync engine resolves version conflicts; it is
also possible for the SyncML client's engine to provide some of this functionality. The SyncML
Representation Protocol provides both the functionality to notify the SyncML client of a resolved
conflict and the status codes for common resolution policies. If the server's sync engine resolves
a conflict, it will use the status codes and notification functionality to notify the client of the
conflict and define the terms of its resolution.
3
5. Security
SyncML is intended to provide a framework for secure data synchronization. SyncML itself does
not define any new security schemes. Instead, it provides the framework to challenge
authentication and authorization at different layers of the network. SyncML defines a user
authentication mechanism for three different levels of the protocol : the server level, the database
level, and the object level. SyncML mandates only that its authentication mechanism be
supported at the server level. To be compliant with the SyncML protocol, a SyncML client or
server must support both basic and MD5 authentication. Authentication at the database and
object levels is optional.
ADVANTAGES
It was a good decision to use XML as superset of SyncML, because XML ensures compatibility
with other software applications and libraries. XML is also a human readable format. This would
not have been the case with a binary protocol.
Apart from this, SyncML is a quite well documented, unifying approach to mobile devices
synchronization. Its strategy with freely available specifications may be the key to a future with
painless cross-platform synchronization, because it is not only theoretically a good aproach, but
also backed by many key-players in the mobile device industry.
DISADVANTAGES
Unfortunately, all that glitters is not gold. SyncML is so extensive, that it is hard to understand in
its entirety, not to speak of a complex implementation. It contains too many possibilities where
to place different information, too many and even (deliberate) duplicate operations. It includes
many sub-tasks like meta information, device management, device information - these are surely
important when building complete device management platforms, but complicate matters
needlessly. This leads to the fact that if we wanted to implement a SyncML compatible
application, a lot of developing work had to be done - there is no such thing like a minimal
instance of SyncML.
Another downside may be the fact that Microsoft is not member of the SyncML initiative - Ray
Hegarty wrote in 2001, two years after the SyncML initiative had been launched, ``Microsoft
seems to have finally come off the fence as far as potential support for SyncML is concerned,
saying that the specification is too 'chatty' and relies on too much network bandwidth'' . In other
words, Microsoft will not support SyncML.
This leads to another point: Even when using a binary form of XML (like
WBXML), SyncML uses rather many (too many, in the author's opinion) packets during network
communication. This seems to correlate with the complexity of the protocol.
In the above figure, Application A represents a networked service that provides synchronization
with other client applications (Application B). The server and client are connected over any
network transport (HTTP, WSP).
The client uses the Sync Client Agent to access the network and send messages to the server via
the SyncML Adapter and SyncML Interface (SyncML I/F). The server, or Application A,
through the Sync Server Agent, receives or sends messages, and manages the entire sync process
through the Sync Engine. A SyncML I/F is merely an API to the SyncML Adapter.
6
SyncML operations are conceptually bound into a SyncML Package, which is a conceptual
frame for one or more required SyncML messages. A SyncML message is a well-formed XML
document identified by the SyncML root or document element type. The document consists of a
header (SyncHdr element type) and a body (SyncBody element type).
The header specifies routing and versioning information, while the body is a container for one or
more SyncML Commands. The commands are containers for other element types that describe
the specifics of the command, including any synchronization data or meta information.
Incorporated here, too, are features such as SyncML Data Formats (a common set of media types
for commonly accepted information such as calendars and contacts) and SyncML Capabilities
Exchange (in which a SyncML client and server determine what device, user, and application
features each supports) are incorporated.
For example, a mobile phone acts as the SyncML client, and a server acts as the SyncML server.
The SyncML client sends a message to the SyncML server regarding changes to data made on
the client. The server then synchronizes the data within the SyncML messages with data stored
on the server, and returns modifications back to the SyncML client. The SyncML client contains
a sync client agent, and typically has the role of sending modifications first to the server. The
client is typically a mobile phone or PDA, and must also be capable of receiving messages back
from the server.
The SyncML server contains the sync server agent and the sync engine, and usually waits for the
client to initiate synchronization, although the server can initiate synchronizations if unsolicited
commands are supported on the transport protocol level.
TYPES OF SYNCHRONIZATION
SyncML specifies seven different synchronization types, as follows:
1) Two-way sync: Two-way sync is a normal synchronization type in which client and server
exchange information about any modifications to the data each contains. The client always
initiates this exchange by sending a request to the server. The server processes the
synchronization request and the data from the client is compared and unified with the data on the
server. After that, the server sends its modified data to the client device, which is then able to
update its database with the data from the server. Once it has updated its database, the client
sends back the server all the necessary mapping information
2) Slow sync: The slow sync is a form of the two-way synchronization in which all the items in
the client databases are compared with all the items in the server databases on a fieldby- field
basis. A slow sync can be requested if the client and server sync anchors are mismatched or if the
client or server loses its change log information. In practice, the slow sync means that the client
sends all its data to the server and the server does a field by- field analysis, comparing its own
data with that sent by the client. After the sync analysis, the server returns all the modification
information to the client. In turn, the client returns the mapping information for all data items
added by the server.
3) One-way sync from client only: This is a synchronization type in which the client sends its
modifications to the server but the server does not send its modifications back to the client.
4) Refresh sync from client only: Here the client exports all its data from a database to the server.
The server is expected to replace all data in the target database with the data sent by the client.
5) One-way sync from server only: With this, the client gets all modifications from the server but
the client does not send its modifications to the server.
6) Refresh sync from server only: In this scenario the server exports all its data from a database
to the client. The client is expected to replace all data in the target database with the data sent by
the server.
7) Server-alerted sync: Here the server informs the client of the need to initiate a specific type of
synchronization with the server.
SYNCHRONIZATION PROCEDURE
With this basic understanding of SyncML, we can begin to talk in detail about what happens
between a SyncML client and the server during a synchronization procedure. Because two way
synching is the most common synchronization procedure, we'll use that procedure as our
example.
A two-way synchronization procedure can be broken out into the following broad steps:
1) Sync initialization
2) Two-way synchronization
3) Data mapping
Sync initialization
No synchronization procedure can occur until the client and server have exchanged initialization
packages. In an initialization procedure, the server and client devices generally exchange the
following information:
Service and device capabilities Requested databases access, type of sync desired Authentication
information Sync anchors are also exchanged as a part of the initialization procedure.
Two-way synchronization
Two-way synchronization is a normal synchronization type in which the client and the server
exchange modifications to the data each contains. The client always initiates this exchange by
sending its data modifications to the server. This is called a synchronization request. The server
processes the synchronization request, comparing and unifying the data from the client with the
10
data in its databases. After that, the server sends its modified data to the client, which is then able
to update its database with the data from the server.
Figure below illustrates the basic steps of two-way synchronization.
The client always initiates a two-way sync, by sending its modifications to the server (Pkg #3).
The client uses internal change log information to determine all the modifications that have
occurred in its databases since the last synchronization.
You will recall that modifications include the addition of new entities, deletion of previous
entities, or updates to existing entities. Each change type is sent to the server using a different
SyncML command. For example, all additions are sent using the Add command and all deletions
are sent using the Delete command.
On receiving the sync package from the client, the server processes the commands sent by the
client, incorporating all the modifications into its databases. The server is responsible for
handling any version conflicts that may arise in this process. The server then builds a status
report consisting of all the commands sent by the client combined with its own data
modifications and sends its synchronization package to the client (Pkg 4).
11
Data mapping
Upon receiving the synchronization package from the server, the client processes all the
commands. It then creates a data status update to inform the server of the results of the data
update on the client side (Pkg #5). This status update will include a set of map operations, which
allow the server to match up all the LUIDs and GUIDs in its mapping table. The update package
may not be sent if the server has indicated that it does not require a response to its last package.
If the client does not send the update, it must cache the Map operations until the next
synchronization.
12
CONCLUSION
SyncML, launched in February 2000, marked the coming together of industry leaders (Ericsson,
IBM, Motorola, and Nokia, among others) to resolve the synchronization problem. With the
February 2002 release of the SyncML version 1.1 specification, we have our chance to begin
working in earnest with what already promises to be a groundbreaking protocol. SyncML is an
ideal choice for mobile computing, freeing up memory for other applications. In the first half of
2002 first devices equipped with SyncML have reached the market, (e.g. Nokia Communicator
9210 or mobiles from Ericsson like T39m, T68,R520m and T65)).
Nokia was the first company in the world to introduce SyncML-enabled products. SyncML an
open industry specification for data synchronization is designed to meet the needs of the mobile
user and there any-device, any-network synchronization needs. With SyncML, networked
information can be synchronized with any mobile device, and mobile information can be
synchronized with any networked applications. SyncML is not limited to mobile phone users - it
also enables synchronization over other transmission channels such as fixed networks, infrared,
cable, or Bluetooth. In fact, SyncML will even allow users to synchronize information stored on
compatible Web-based applications.
13
REFERENCES
1. Synchronizing and Managing Your Mobile Data book by Riku M. Mettala, Peter Thompson
2. Project thesis on SyncML by Peter Czech at springme.com
3. http://en.wikibooks.org/wiki/XML_Managing_Data_Exchange/SyncML#SyncML_ specifica.
14