Data Sync
Transports
the ditto peer to peer network architecture supports both direct communication between small peers (device to device) and communication by way of a server ( docid\ syt1bx8zpniunkjo7wzse ) that connects and transmits data between small peers (device to server to device) this dual approach provides flexibility — your app remains efficient in any network environment and you control when and what routes through a central server to enable all transports, call transportconfig enablepeertopeer() ; otherwise, enable them one by one for step by step instructions, see docid\ iic3gevlppflwzt1sbljr following are the various transports ditto uses to facilitate peer to peer communication across peers /#bluetooth low energy /#apple wireless direct link /#wi fi aware /#local area network /#websockets video overview bluetooth low energy ditto utilizes both traditional wi fi and bluetooth low energy (le) to maintain a continuous mesh network of transmission control protocol (tcp) connections bluetooth le technology forms low powered and high distance connections between devices, making it highly performant in offline scenarios when replicating small amounts of data in the event of a wi fi network disruption, such as a router getting disconnected, ditto does not automatically switch transports to establish an independent bluetooth le connection as a fallback instead, ditto actively works to maintain the previously established wi fi and bluetooth le connections performance the following distances and bandwidth limitations and capacities are approximations and vary depending on the bluetooth® firmware installed in the end user environment syncing large documents can significantly impact network performance caution is advised when handling large binary data, such as a high resolution image or video exceeding 50 megapixels; a deeply embedded document; or a very large document instead of storing files exceeding 250kb directly within a document object, carefully consider using attachments for more information, see docid\ p6opubbna hc2dcjwshs most devices manufactured during or after 2017 are equipped with bluetooth le version 5 0 bandwidth capacity discoverability range distance durability 20 kilobyte (kb) maximum per 1 second interval 30 to 60 meter maximum for v 4 0, 80 meter maximum for v 5 0, 130 meter maximum limitations bluetooth le performance declines in the following scenarios there are physical obstructions, radio signal attenuation, radio frequency congestion, upon other environment challenges replicating large amounts of binary data, such as high resolution image files or large document objects when replicating large amount of data, use an docid\ onyzdx8asj26ihb dufq5 type to encode the data instead of a docid\ fxfiuik0ojdz4jnlja 75 in addition, when ios devices establish a bluetooth connection with android devices the connection is visible to your end user by way of the ios bluetooth settings when your app is forced closed on the ios device, the bluetooth connection to the android device is automatically terminated visibility of these ios to android bluetooth connections in the ios settings is intended for informational purposes only and does not impose any limitations on the number of bluetooth devices that can connect to the mesh peer to peer wi fi the bandwidth capacity and distance limitation of peer to peer wi fi connections depend on the end user environment, as different devices and platforms support varying wi fi technologies the following table provides an overview of the wi fi technologies ditto supports, organized by platform platform ditto supported technology apple apple wireless direct link (awdl) android wi fi aware apple wireless direct link unlike bluetooth le, which enables peers to establish cross platform connections between devices, the apple wireless direct link (awdl) transport type can only be utilized to sync data between apple devices peers within an end user environment of the apple platform can use awdl for point to point communication, enabling extremely fast, high bandwidth sync for ios and macos devices this makes it highly performant when replicating large amounts of data such as high resolution videos and images or files performance awdl enabled mesh communication between apple based peers has significantly higher bandwidth compared to bluetooth le, allowing for low latency, high speed data transfers bandwidth capacity discoverability range distance durability 5 ghz frequency range 1 gigabyte maximum per 8 second interval 30 to 60 meter maximum 35 meter maximum limitations with an average maximum range of 35 meters from point to point, awdl allows for shorter distances of communication compared to bluetooth le, which can be sustained for distances up to 130 meters wi fi aware wi fi aware technology is a new open standard that you can use to establish a mesh network connection between devices running on the windows or android platform performance wi fi aware, similar to awdl for the apple platform, offers significantly higher bandwidth compared to bluetooth le, allowing for low latency, high speed data transfers between android or windows devices the following specifications are approximations; the type of device and platform as well as its network configurations ultimately determine range and performance bandwidth capacity discoverability range distance durability 2 4 to 5 ghz frequency range 1 gigabyte per 8 ‑ second interval 100 to 300 meter maximum 100 to 300 meter maximum limitations wi fi aware connections have a limited range of shorter distances of communication compared to bluetooth le, which can be sustained for distances up to 130 meters local area network when devices are connected over the same wi fi access point or through other means like an ethernet cable, they can take advantage of a local area network ( lan ), if available, to communicate directly with each other without requiring internet access a lan is an interconnected network made up of devices that are physically near each other, such as a home, enterprise, or college campus to ensure that ditto’s discovery protocol is working effectively, it is important to disable the client isolation mode feature on the wi fi router or access point that you are using for the lan for instructions, see the official documentation provided by the manufacturer note that the exact name of the feature may vary depending on the manufacturer and the specific model of wi fi router or access point; however, the term “isolation” is commonly included in the feature name performance in general, lan based connections offer significantly higher bandwidth capacities compared to bluetooth le, allowing for low latency, high speed data transfers the following specifications are approximations; the quality of the network infrastructure, as well as the network configurations and amount of network traffic ultimately determine range and performance disabled by default, if you want devices located within the same lan to find and identify each other automatically, manually enable ip multicasting entitlement for each device for more information, see /#optimizations , as follows bandwidth capacity discoverability range distance durability traditional lans 1 to 10 mbps maximum; higher for fiber optic lans 200 meter maximum 200 meter maximum limitations the following are common conditions that contribute to a decline in lan performance factor description network congestion when there is a high volume of network traffic, in which multiple devices utilize the lan at the same time, data transfer speeds and response times lag distance to the router or access point when devices are physically located far away from the router or access point, connections become unreliable or even unavailable altogether network security and privacy network infrastructure enabled with various security controls, such as the client isolation mode feature, may directly or indirectly affect performance for more information, see /#security and privacy client isolation mode , as follows ios direct connections with desktop based apps by default, ios devices require the ip multicast entitlement to establish direct connections with desktop platforms, such as windows for more information, see /#ios to desktop connections , as follows optimizations there are various strategies you can implement in your app to improve the overall responsiveness of your lan, minimize bandwidth consumption, and enhance the reliability of your peer to peer lan connections this section provides an overview of the different optimization strategies you can use to make the most out of your lan setup optional discovery protocol ip multicasting ditto optionally offers an optimized discovery protocol that utilizes the user datagram protocol (udp) and employs internet protocol ( ip ) multicasting ip multicasting is a method of reducing traffic on the lan and optimizing performance of automatic device discovery disabled by default, if you want devices located within the same lan to find and identify each other automatically, manually enable ip multicasting entitlement before ios devices can establish a direct connection with desktop platforms over lan, the end user must grant permissions for more information, see ios to desktop lan connections security and privacy client isolation mode if network infrastructure is configured with client isolation mode enabled, devices are unable to discover each other and form a lan connection client isolation mode is a network security and privacy feature offered by most wi fi routers and access points that prevents devices on the same wi fi network from communicating directly with one another to ensure that ditto’s discovery protocol is working effectively, it is important to disable the client isolation mode feature on the wi fi router or access point that you are using for the lan for instructions, see the official documentation provided by the manufacturer note that the exact name of the feature may vary depending on the manufacturer and the specific model of the wi fi router or access point; however, the term “isolation” is commonly included in the feature name ios to desktop connections apple requires ios device end users to grant permissions before a lan connection with desktop based devices can be established, such as an ios device connecting directly with a desktop app running on the windows operating system by default, ios devices can connect with other mobile devices of any platform for example, an ios device can connect directly with an android device over lan if you want your ios app to connect to desktop based apps over lan, request the multicast entitlement directly from apple, and then, once received, add the multicast entitlement to your ios app for instructions, see the official apple documentation > entitlements > https //developer apple com/documentation/bundleresources/entitlements/com apple developer networking multicast websockets small peers connect with the big peer by way of websocket connections supported on all devices, regardless of model and platform, the websocket communication protocol is the most commonly available transport protocol for realtime communication a websocket is a full duplex communication protocol that enables a long lived connection between small peers and the big peer communication is referred to as full duplex when the client and server can communicate in a bidirectional, back and forth manner allowing for low latency data exchange a connection is considered long lived when, once established, it remains open for an extended period of time referred to as the playground token , small peers use this passphrase to authenticate with the big peer once authenticated, the big peer issues a unique json web token (jwt) to establish and ensure persistence of connection between small peers and the big peer as long as the playground token remains active, your connection persists for more information, see discover basics > docid\ hk2s3ld8sj ti5snxwkq1 lan based websocket connections unlike other transports used for peer to peer communication, the websocket does not come with built in automatic device discovery capabilities and requires manual configuration before a websocket connection between devices over lan can be established for instructions on how to specify an ip/port for a lan based websocket connection, see docid\ iic3gevlppflwzt1sbljr