12fc30decSRandy Dunlap.. SPDX-License-Identifier: GPL-2.0 22fc30decSRandy Dunlap 32fc30decSRandy Dunlap================= 42fc30decSRandy DunlapLinux Kernel TIPC 52fc30decSRandy Dunlap================= 62fc30decSRandy Dunlap 7*09ef1786SXin LongIntroduction 8*09ef1786SXin Long============ 92fc30decSRandy Dunlap 10*09ef1786SXin LongTIPC (Transparent Inter Process Communication) is a protocol that is specially 11*09ef1786SXin Longdesigned for intra-cluster communication. It can be configured to transmit 12*09ef1786SXin Longmessages either on UDP or directly across Ethernet. Message delivery is 13*09ef1786SXin Longsequence guaranteed, loss free and flow controlled. Latency times are shorter 14*09ef1786SXin Longthan with any other known protocol, while maximal throughput is comparable to 15*09ef1786SXin Longthat of TCP. 16*09ef1786SXin Long 17*09ef1786SXin LongTIPC Features 18*09ef1786SXin Long------------- 19*09ef1786SXin Long 20*09ef1786SXin Long- Cluster wide IPC service 21*09ef1786SXin Long 22*09ef1786SXin Long Have you ever wished you had the convenience of Unix Domain Sockets even when 23*09ef1786SXin Long transmitting data between cluster nodes? Where you yourself determine the 24*09ef1786SXin Long addresses you want to bind to and use? Where you don't have to perform DNS 25*09ef1786SXin Long lookups and worry about IP addresses? Where you don't have to start timers 26*09ef1786SXin Long to monitor the continuous existence of peer sockets? And yet without the 27*09ef1786SXin Long downsides of that socket type, such as the risk of lingering inodes? 28*09ef1786SXin Long 29*09ef1786SXin Long Welcome to the Transparent Inter Process Communication service, TIPC in short, 30*09ef1786SXin Long which gives you all of this, and a lot more. 31*09ef1786SXin Long 32*09ef1786SXin Long- Service Addressing 33*09ef1786SXin Long 34*09ef1786SXin Long A fundamental concept in TIPC is that of Service Addressing which makes it 35*09ef1786SXin Long possible for a programmer to chose his own address, bind it to a server 36*09ef1786SXin Long socket and let client programs use only that address for sending messages. 37*09ef1786SXin Long 38*09ef1786SXin Long- Service Tracking 39*09ef1786SXin Long 40*09ef1786SXin Long A client wanting to wait for the availability of a server, uses the Service 41*09ef1786SXin Long Tracking mechanism to subscribe for binding and unbinding/close events for 42*09ef1786SXin Long sockets with the associated service address. 43*09ef1786SXin Long 44*09ef1786SXin Long The service tracking mechanism can also be used for Cluster Topology Tracking, 45*09ef1786SXin Long i.e., subscribing for availability/non-availability of cluster nodes. 46*09ef1786SXin Long 47*09ef1786SXin Long Likewise, the service tracking mechanism can be used for Cluster Connectivity 48*09ef1786SXin Long Tracking, i.e., subscribing for up/down events for individual links between 49*09ef1786SXin Long cluster nodes. 50*09ef1786SXin Long 51*09ef1786SXin Long- Transmission Modes 52*09ef1786SXin Long 53*09ef1786SXin Long Using a service address, a client can send datagram messages to a server socket. 54*09ef1786SXin Long 55*09ef1786SXin Long Using the same address type, it can establish a connection towards an accepting 56*09ef1786SXin Long server socket. 57*09ef1786SXin Long 58*09ef1786SXin Long It can also use a service address to create and join a Communication Group, 59*09ef1786SXin Long which is the TIPC manifestation of a brokerless message bus. 60*09ef1786SXin Long 61*09ef1786SXin Long Multicast with very good performance and scalability is available both in 62*09ef1786SXin Long datagram mode and in communication group mode. 63*09ef1786SXin Long 64*09ef1786SXin Long- Inter Node Links 65*09ef1786SXin Long 66*09ef1786SXin Long Communication between any two nodes in a cluster is maintained by one or two 67*09ef1786SXin Long Inter Node Links, which both guarantee data traffic integrity and monitor 68*09ef1786SXin Long the peer node's availability. 69*09ef1786SXin Long 70*09ef1786SXin Long- Cluster Scalability 71*09ef1786SXin Long 72*09ef1786SXin Long By applying the Overlapping Ring Monitoring algorithm on the inter node links 73*09ef1786SXin Long it is possible to scale TIPC clusters up to 1000 nodes with a maintained 74*09ef1786SXin Long neighbor failure discovery time of 1-2 seconds. For smaller clusters this 75*09ef1786SXin Long time can be made much shorter. 76*09ef1786SXin Long 77*09ef1786SXin Long- Neighbor Discovery 78*09ef1786SXin Long 79*09ef1786SXin Long Neighbor Node Discovery in the cluster is done by Ethernet broadcast or UDP 80*09ef1786SXin Long multicast, when any of those services are available. If not, configured peer 81*09ef1786SXin Long IP addresses can be used. 82*09ef1786SXin Long 83*09ef1786SXin Long- Configuration 84*09ef1786SXin Long 85*09ef1786SXin Long When running TIPC in single node mode no configuration whatsoever is needed. 86*09ef1786SXin Long When running in cluster mode TIPC must as a minimum be given a node address 87*09ef1786SXin Long (before Linux 4.17) and told which interface to attach to. The "tipc" 88*09ef1786SXin Long configuration tool makes is possible to add and maintain many more 89*09ef1786SXin Long configuration parameters. 90*09ef1786SXin Long 91*09ef1786SXin Long- Performance 92*09ef1786SXin Long 93*09ef1786SXin Long TIPC message transfer latency times are better than in any other known protocol. 94*09ef1786SXin Long Maximal byte throughput for inter-node connections is still somewhat lower than 95*09ef1786SXin Long for TCP, while they are superior for intra-node and inter-container throughput 96*09ef1786SXin Long on the same host. 97*09ef1786SXin Long 98*09ef1786SXin Long- Language Support 99*09ef1786SXin Long 100*09ef1786SXin Long The TIPC user API has support for C, Python, Perl, Ruby, D and Go. 101*09ef1786SXin Long 102*09ef1786SXin LongMore Information 103*09ef1786SXin Long---------------- 104*09ef1786SXin Long 105*09ef1786SXin Long- How to set up TIPC: 106*09ef1786SXin Long 107*09ef1786SXin Long http://tipc.io/getting_started.html 108*09ef1786SXin Long 109*09ef1786SXin Long- How to program with TIPC: 110*09ef1786SXin Long 111*09ef1786SXin Long http://tipc.io/programming.html 112*09ef1786SXin Long 113*09ef1786SXin Long- How to contribute to TIPC: 114*09ef1786SXin Long 115*09ef1786SXin Long- http://tipc.io/contacts.html 116*09ef1786SXin Long 117*09ef1786SXin Long- More details about TIPC specification: 118*09ef1786SXin Long 119*09ef1786SXin Long http://tipc.io/protocol.html 120*09ef1786SXin Long 121*09ef1786SXin Long 122*09ef1786SXin LongImplementation 123*09ef1786SXin Long============== 124*09ef1786SXin Long 125*09ef1786SXin LongTIPC is implemented as a kernel module in net/tipc/ directory. 1262fc30decSRandy Dunlap 1272fc30decSRandy DunlapTIPC Base Types 1282fc30decSRandy Dunlap--------------- 1292fc30decSRandy Dunlap 1302fc30decSRandy Dunlap.. kernel-doc:: net/tipc/subscr.h 1312fc30decSRandy Dunlap :internal: 1322fc30decSRandy Dunlap 1332fc30decSRandy Dunlap.. kernel-doc:: net/tipc/bearer.h 1342fc30decSRandy Dunlap :internal: 1352fc30decSRandy Dunlap 1362fc30decSRandy Dunlap.. kernel-doc:: net/tipc/name_table.h 1372fc30decSRandy Dunlap :internal: 1382fc30decSRandy Dunlap 1392fc30decSRandy Dunlap.. kernel-doc:: net/tipc/name_distr.h 1402fc30decSRandy Dunlap :internal: 1412fc30decSRandy Dunlap 1422fc30decSRandy Dunlap.. kernel-doc:: net/tipc/bcast.c 1432fc30decSRandy Dunlap :internal: 1442fc30decSRandy Dunlap 1452fc30decSRandy DunlapTIPC Bearer Interfaces 1462fc30decSRandy Dunlap---------------------- 1472fc30decSRandy Dunlap 1482fc30decSRandy Dunlap.. kernel-doc:: net/tipc/bearer.c 1492fc30decSRandy Dunlap :internal: 1502fc30decSRandy Dunlap 1512fc30decSRandy Dunlap.. kernel-doc:: net/tipc/udp_media.c 1522fc30decSRandy Dunlap :internal: 1532fc30decSRandy Dunlap 1542fc30decSRandy DunlapTIPC Crypto Interfaces 1552fc30decSRandy Dunlap---------------------- 1562fc30decSRandy Dunlap 1572fc30decSRandy Dunlap.. kernel-doc:: net/tipc/crypto.c 1582fc30decSRandy Dunlap :internal: 1592fc30decSRandy Dunlap 1602fc30decSRandy DunlapTIPC Discoverer Interfaces 1612fc30decSRandy Dunlap-------------------------- 1622fc30decSRandy Dunlap 1632fc30decSRandy Dunlap.. kernel-doc:: net/tipc/discover.c 1642fc30decSRandy Dunlap :internal: 1652fc30decSRandy Dunlap 1662fc30decSRandy DunlapTIPC Link Interfaces 1672fc30decSRandy Dunlap-------------------- 1682fc30decSRandy Dunlap 1692fc30decSRandy Dunlap.. kernel-doc:: net/tipc/link.c 1702fc30decSRandy Dunlap :internal: 1712fc30decSRandy Dunlap 1722fc30decSRandy DunlapTIPC msg Interfaces 1732fc30decSRandy Dunlap------------------- 1742fc30decSRandy Dunlap 1752fc30decSRandy Dunlap.. kernel-doc:: net/tipc/msg.c 1762fc30decSRandy Dunlap :internal: 1772fc30decSRandy Dunlap 1782fc30decSRandy DunlapTIPC Name Interfaces 1792fc30decSRandy Dunlap-------------------- 1802fc30decSRandy Dunlap 1812fc30decSRandy Dunlap.. kernel-doc:: net/tipc/name_table.c 1822fc30decSRandy Dunlap :internal: 1832fc30decSRandy Dunlap 1842fc30decSRandy Dunlap.. kernel-doc:: net/tipc/name_distr.c 1852fc30decSRandy Dunlap :internal: 1862fc30decSRandy Dunlap 1872fc30decSRandy DunlapTIPC Node Management Interfaces 1882fc30decSRandy Dunlap------------------------------- 1892fc30decSRandy Dunlap 1902fc30decSRandy Dunlap.. kernel-doc:: net/tipc/node.c 1912fc30decSRandy Dunlap :internal: 1922fc30decSRandy Dunlap 1932fc30decSRandy DunlapTIPC Socket Interfaces 1942fc30decSRandy Dunlap---------------------- 1952fc30decSRandy Dunlap 1962fc30decSRandy Dunlap.. kernel-doc:: net/tipc/socket.c 1972fc30decSRandy Dunlap :internal: 1982fc30decSRandy Dunlap 1992fc30decSRandy DunlapTIPC Network Topology Interfaces 2002fc30decSRandy Dunlap-------------------------------- 2012fc30decSRandy Dunlap 2022fc30decSRandy Dunlap.. kernel-doc:: net/tipc/subscr.c 2032fc30decSRandy Dunlap :internal: 2042fc30decSRandy Dunlap 2052fc30decSRandy DunlapTIPC Server Interfaces 2062fc30decSRandy Dunlap---------------------- 2072fc30decSRandy Dunlap 2082fc30decSRandy Dunlap.. kernel-doc:: net/tipc/topsrv.c 2092fc30decSRandy Dunlap :internal: 2102fc30decSRandy Dunlap 2112fc30decSRandy DunlapTIPC Trace Interfaces 2122fc30decSRandy Dunlap--------------------- 2132fc30decSRandy Dunlap 2142fc30decSRandy Dunlap.. kernel-doc:: net/tipc/trace.c 2152fc30decSRandy Dunlap :internal: 216