SlideShare une entreprise Scribd logo
1  sur  19
D-Bus
Emre Can Kucukoglu
eckucukoglu@gmail.com
06.08.2015
What is d-bus?
Desktop bus, IPC mechanism.
Medium for local communication between processes
running on the same host.
1:1 request-reply, 1:n publish-subscribe.
Structured view of the data.
messages can be validated and ill-formed messages rejected.
low-level C binding, also Java, Perl and Python.
2
Buses
Processes connect to the daemon
using the library.
p2p communication library:
used by any two processes in order to exchange
messages among themselves.
the daemon:
any number of processes may be connected at
any given time.
Multiple buses may be active
simultaneously.
system bus:
system-wide communication.
session bus:
single user's ongoing session.
● Addresses describes how to connect to bus such as "/tmp/.hiddensocket”. They completely
hidden from the client process by the dbus library.
3
Connections
When a connection is set up, the bus immediately assigns it an immutable bus
name that it will retain for as long as the bus exists.
Services under well-known names that are agreed upon by convention, like
org.freedesktop.DBus.
4
Object model
objects,
proxies,
methods,
signals,
interfaces.
5
Objects
Created by a client process,
Exists within the context of that client's connection to the bus.
Message types carried by the bus:
Requests sent to objects by client processes.
Replies to requests, going from an object back to a requesting process.
One-way messages emanating from objects, broadcast to any connected clients
that have registered an interest in them.
6
Proxies
Local representation of an object that is really accessed through the bus, and
typically lives outside your program.
GLib binding’s proxies support failover.
7
Methods
When a client sends a request to an object, it sees this request as invoking a
method on the object.
Arguments can be passed and result back to the requester, along with either
result data or exception information.
Messages are encapsulated by d-bus library.
Both asynchronous & synchronous method invocation.
8
Signals
One-way communications come from an object and go client processes.
Client processes can register an interest in signals of a particular name
coming from a particular object.
There are no replies to signals.
No input and output parameters like methods do.
Allow clients to restrict their interest to cases where certain of the signal's
parameters match given values.
9
Interfaces
Every object supports particular methods and may emit particular signals.
These are specified in interfaces.
When a client invokes a method or listens for a signal, it must indicate the
object and the member {methods, signals} it is referring to.
10
Addressing
11
Overview picture
12
furthermore; Activation
Bus daemon can be instructed to start clients automatically when needed.
To achieve that describe client in a service file.
Default path: /usr/share/dbus-1/services/*.service
For example: client program /usr/local/bin/bankcounter can be run to provide
well-known bus names com.bigmoneybank.Deposits and
com.bigmoneybank.Withdrawals.
# Sample bankcounter.service file
[D-BUS Service]
Names=com.bigmoneybank.Deposits;
com.bigmoneybank.Withdrawals
Exec=/usr/local/bin/bankcounter
13
Performance
One-to-one communication was about 2.5x slower than simply pushing the
data raw over a socket.
Bus daemon should be about twice as slow as one-to-one mode, because a
round trip involves four socket reads/writes rather than two socket
reads/writes.
Overhead comes from:
Abstraction penalty (marshalling)
Data validation (‘no validation’ mode exist, but not recommended)
Raw bandwidth isn't the only concern; D-Bus is designed to enable
asynchronous communication and avoid round trips. This is frequently a
more important performance issue than throughput.
14
Why D-Bus?
difference from other IPC protocols:
d-bus is also lifecycle tracking, service activation, security policy, and
other higher-level structure and assumptions.
not good for:
internet applications,
clustering, distributed swarms, peer-to-peer.
good for:
desktop application talks to other parts of the desktop session,
communications between system daemons and communications between
the desktop and system daemons.
15
Why D-Bus?
Method call transition, signals, properties, oo, broadcasting,
discovery, introspection, policy, activation, synchronization,
type-safe marshalling, security, monitoring, exposes APIs/not
streams, passing of credentials, file descriptor passing,
language agnostic, network transparency, no trust required,
high-level error concepts.
retrieved from http://0pointer.de/public/lca.pdf
16
Drawbacks
Used for control, not payload.
Inefficient (10 copies, 4 validations, 4 context switches per
duplex method call transaction)
No implicit timestamping.
Not available in boot time.
Security framework hooks happen in userspace.
retrieved from http://0pointer.de/public/lca.pdf
17
alternative: kdbus
Efficient (2 or fewer copies, 2 validations, 2 context switches per
duplex method call transaction).
Implicit timestamping.
Always available, from earliest boot to latest shutdown.
Security framework hooks happen in kernel space.
retrieved from http://0pointer.de/public/lca.pdf
18
References
freedesktop.org: intr. to dbus.
freedesktop.org: dbus faq.
maemo: dbus.
qt 4.8: dbus documentation.
wiki: dbus.
linux.conf.au.: Lennart Poettering.
19

Contenu connexe

Tendances

Class notes fhrp,hsrp,vrrp
Class notes fhrp,hsrp,vrrpClass notes fhrp,hsrp,vrrp
Class notes fhrp,hsrp,vrrpSagarR24
 
Apache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data ProcessingApache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data ProcessingDataWorks Summit
 
Apache Spark Introduction and Resilient Distributed Dataset basics and deep dive
Apache Spark Introduction and Resilient Distributed Dataset basics and deep diveApache Spark Introduction and Resilient Distributed Dataset basics and deep dive
Apache Spark Introduction and Resilient Distributed Dataset basics and deep diveSachin Aggarwal
 
Design Cloud system: InfiniBand vs. Ethernet
Design Cloud system: InfiniBand vs. EthernetDesign Cloud system: InfiniBand vs. Ethernet
Design Cloud system: InfiniBand vs. EthernetPatrik Kristel
 
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpPushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpJames Denton
 
Network Monitoring with The Dude and Whatsapp
Network Monitoring with The Dude and WhatsappNetwork Monitoring with The Dude and Whatsapp
Network Monitoring with The Dude and WhatsappGLC Networks
 
Redis cluster
Redis clusterRedis cluster
Redis clusteriammutex
 
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...Databricks
 
Apache Spark Tutorial | Spark Tutorial for Beginners | Apache Spark Training ...
Apache Spark Tutorial | Spark Tutorial for Beginners | Apache Spark Training ...Apache Spark Tutorial | Spark Tutorial for Beginners | Apache Spark Training ...
Apache Spark Tutorial | Spark Tutorial for Beginners | Apache Spark Training ...Edureka!
 
Apache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
Apache Spark Data Source V2 with Wenchen Fan and Gengliang WangApache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
Apache Spark Data Source V2 with Wenchen Fan and Gengliang WangDatabricks
 
Microservices with event source and CQRS
Microservices with event source and CQRSMicroservices with event source and CQRS
Microservices with event source and CQRSMd Ayub Ali Sarker
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Diverajdeep
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikGLC Networks
 

Tendances (20)

Apache Spark Core
Apache Spark CoreApache Spark Core
Apache Spark Core
 
Class notes fhrp,hsrp,vrrp
Class notes fhrp,hsrp,vrrpClass notes fhrp,hsrp,vrrp
Class notes fhrp,hsrp,vrrp
 
Apache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data ProcessingApache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data Processing
 
Apache Spark Introduction and Resilient Distributed Dataset basics and deep dive
Apache Spark Introduction and Resilient Distributed Dataset basics and deep diveApache Spark Introduction and Resilient Distributed Dataset basics and deep dive
Apache Spark Introduction and Resilient Distributed Dataset basics and deep dive
 
Design Cloud system: InfiniBand vs. Ethernet
Design Cloud system: InfiniBand vs. EthernetDesign Cloud system: InfiniBand vs. Ethernet
Design Cloud system: InfiniBand vs. Ethernet
 
Ftp
FtpFtp
Ftp
 
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpPushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
 
MapReduce
MapReduceMapReduce
MapReduce
 
Network Monitoring with The Dude and Whatsapp
Network Monitoring with The Dude and WhatsappNetwork Monitoring with The Dude and Whatsapp
Network Monitoring with The Dude and Whatsapp
 
Ipc in linux
Ipc in linuxIpc in linux
Ipc in linux
 
Process scheduling linux
Process scheduling linuxProcess scheduling linux
Process scheduling linux
 
Redis cluster
Redis clusterRedis cluster
Redis cluster
 
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
Hudi: Large-Scale, Near Real-Time Pipelines at Uber with Nishith Agarwal and ...
 
Apache Spark Tutorial | Spark Tutorial for Beginners | Apache Spark Training ...
Apache Spark Tutorial | Spark Tutorial for Beginners | Apache Spark Training ...Apache Spark Tutorial | Spark Tutorial for Beginners | Apache Spark Training ...
Apache Spark Tutorial | Spark Tutorial for Beginners | Apache Spark Training ...
 
Apache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
Apache Spark Data Source V2 with Wenchen Fan and Gengliang WangApache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
Apache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
 
Quick 3GPP RRC ASN.1
Quick 3GPP RRC ASN.1Quick 3GPP RRC ASN.1
Quick 3GPP RRC ASN.1
 
Microservices with event source and CQRS
Microservices with event source and CQRSMicroservices with event source and CQRS
Microservices with event source and CQRS
 
Apache Airflow
Apache AirflowApache Airflow
Apache Airflow
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Dive
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with Mikrotik
 

Similaire à D-bus basics

Designing Application over mobile environment
Designing Application over mobile environmentDesigning Application over mobile environment
Designing Application over mobile environmentMaulik Patel
 
Internetworking
InternetworkingInternetworking
InternetworkingRaghu nath
 
Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfsamaghorab
 
Arun prjct dox
Arun prjct doxArun prjct dox
Arun prjct doxBaig Mirza
 
Lecture5 architecture styles.pdf
Lecture5 architecture styles.pdfLecture5 architecture styles.pdf
Lecture5 architecture styles.pdfssuser9d62d6
 
Task communication
Task communicationTask communication
Task communication1jayanti
 
distributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxdistributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxlencho3d
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...Sehrish Asif
 
characteristicsofdistributedsystem-121004123308-phpapp02.ppt
characteristicsofdistributedsystem-121004123308-phpapp02.pptcharacteristicsofdistributedsystem-121004123308-phpapp02.ppt
characteristicsofdistributedsystem-121004123308-phpapp02.pptRamkumardevendiranDe
 
Module1 Mobile Computing Architecture
Module1 Mobile Computing ArchitectureModule1 Mobile Computing Architecture
Module1 Mobile Computing Architectureraksharao
 
Presentation of ditributed system
Presentation of ditributed systemPresentation of ditributed system
Presentation of ditributed systemgoogle
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsAya Mahmoud
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding GuideSoftware architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding GuideMohammed Fazuluddin
 
Note: Introduction to Computer Networks
Note: Introduction to Computer Networks Note: Introduction to Computer Networks
Note: Introduction to Computer Networks Hasibul Islam Nirob
 
An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...IOSR Journals
 

Similaire à D-bus basics (20)

Designing Application over mobile environment
Designing Application over mobile environmentDesigning Application over mobile environment
Designing Application over mobile environment
 
Chapter 3-Processes.ppt
Chapter 3-Processes.pptChapter 3-Processes.ppt
Chapter 3-Processes.ppt
 
Internetworking
InternetworkingInternetworking
Internetworking
 
Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdf
 
Arun prjct dox
Arun prjct doxArun prjct dox
Arun prjct dox
 
Lecture5 architecture styles.pdf
Lecture5 architecture styles.pdfLecture5 architecture styles.pdf
Lecture5 architecture styles.pdf
 
Task communication
Task communicationTask communication
Task communication
 
distributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptxdistributed-systemsfghjjjijoijioj-chap3.pptx
distributed-systemsfghjjjijoijioj-chap3.pptx
 
Viloria osi layer4-7
Viloria osi layer4-7Viloria osi layer4-7
Viloria osi layer4-7
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
 
04 Client Server Computing
04 Client Server Computing04 Client Server Computing
04 Client Server Computing
 
Chapter 3-Processes2.pptx
Chapter 3-Processes2.pptxChapter 3-Processes2.pptx
Chapter 3-Processes2.pptx
 
characteristicsofdistributedsystem-121004123308-phpapp02.ppt
characteristicsofdistributedsystem-121004123308-phpapp02.pptcharacteristicsofdistributedsystem-121004123308-phpapp02.ppt
characteristicsofdistributedsystem-121004123308-phpapp02.ppt
 
Module1 Mobile Computing Architecture
Module1 Mobile Computing ArchitectureModule1 Mobile Computing Architecture
Module1 Mobile Computing Architecture
 
Presentation of ditributed system
Presentation of ditributed systemPresentation of ditributed system
Presentation of ditributed system
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systems
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding GuideSoftware architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding Guide
 
Note: Introduction to Computer Networks
Note: Introduction to Computer Networks Note: Introduction to Computer Networks
Note: Introduction to Computer Networks
 
An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...An in-building multi-server cloud system based on shortest Path algorithm dep...
An in-building multi-server cloud system based on shortest Path algorithm dep...
 

Dernier

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Dernier (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

D-bus basics

  • 2. What is d-bus? Desktop bus, IPC mechanism. Medium for local communication between processes running on the same host. 1:1 request-reply, 1:n publish-subscribe. Structured view of the data. messages can be validated and ill-formed messages rejected. low-level C binding, also Java, Perl and Python. 2
  • 3. Buses Processes connect to the daemon using the library. p2p communication library: used by any two processes in order to exchange messages among themselves. the daemon: any number of processes may be connected at any given time. Multiple buses may be active simultaneously. system bus: system-wide communication. session bus: single user's ongoing session. ● Addresses describes how to connect to bus such as "/tmp/.hiddensocket”. They completely hidden from the client process by the dbus library. 3
  • 4. Connections When a connection is set up, the bus immediately assigns it an immutable bus name that it will retain for as long as the bus exists. Services under well-known names that are agreed upon by convention, like org.freedesktop.DBus. 4
  • 6. Objects Created by a client process, Exists within the context of that client's connection to the bus. Message types carried by the bus: Requests sent to objects by client processes. Replies to requests, going from an object back to a requesting process. One-way messages emanating from objects, broadcast to any connected clients that have registered an interest in them. 6
  • 7. Proxies Local representation of an object that is really accessed through the bus, and typically lives outside your program. GLib binding’s proxies support failover. 7
  • 8. Methods When a client sends a request to an object, it sees this request as invoking a method on the object. Arguments can be passed and result back to the requester, along with either result data or exception information. Messages are encapsulated by d-bus library. Both asynchronous & synchronous method invocation. 8
  • 9. Signals One-way communications come from an object and go client processes. Client processes can register an interest in signals of a particular name coming from a particular object. There are no replies to signals. No input and output parameters like methods do. Allow clients to restrict their interest to cases where certain of the signal's parameters match given values. 9
  • 10. Interfaces Every object supports particular methods and may emit particular signals. These are specified in interfaces. When a client invokes a method or listens for a signal, it must indicate the object and the member {methods, signals} it is referring to. 10
  • 13. furthermore; Activation Bus daemon can be instructed to start clients automatically when needed. To achieve that describe client in a service file. Default path: /usr/share/dbus-1/services/*.service For example: client program /usr/local/bin/bankcounter can be run to provide well-known bus names com.bigmoneybank.Deposits and com.bigmoneybank.Withdrawals. # Sample bankcounter.service file [D-BUS Service] Names=com.bigmoneybank.Deposits; com.bigmoneybank.Withdrawals Exec=/usr/local/bin/bankcounter 13
  • 14. Performance One-to-one communication was about 2.5x slower than simply pushing the data raw over a socket. Bus daemon should be about twice as slow as one-to-one mode, because a round trip involves four socket reads/writes rather than two socket reads/writes. Overhead comes from: Abstraction penalty (marshalling) Data validation (‘no validation’ mode exist, but not recommended) Raw bandwidth isn't the only concern; D-Bus is designed to enable asynchronous communication and avoid round trips. This is frequently a more important performance issue than throughput. 14
  • 15. Why D-Bus? difference from other IPC protocols: d-bus is also lifecycle tracking, service activation, security policy, and other higher-level structure and assumptions. not good for: internet applications, clustering, distributed swarms, peer-to-peer. good for: desktop application talks to other parts of the desktop session, communications between system daemons and communications between the desktop and system daemons. 15
  • 16. Why D-Bus? Method call transition, signals, properties, oo, broadcasting, discovery, introspection, policy, activation, synchronization, type-safe marshalling, security, monitoring, exposes APIs/not streams, passing of credentials, file descriptor passing, language agnostic, network transparency, no trust required, high-level error concepts. retrieved from http://0pointer.de/public/lca.pdf 16
  • 17. Drawbacks Used for control, not payload. Inefficient (10 copies, 4 validations, 4 context switches per duplex method call transaction) No implicit timestamping. Not available in boot time. Security framework hooks happen in userspace. retrieved from http://0pointer.de/public/lca.pdf 17
  • 18. alternative: kdbus Efficient (2 or fewer copies, 2 validations, 2 context switches per duplex method call transaction). Implicit timestamping. Always available, from earliest boot to latest shutdown. Security framework hooks happen in kernel space. retrieved from http://0pointer.de/public/lca.pdf 18
  • 19. References freedesktop.org: intr. to dbus. freedesktop.org: dbus faq. maemo: dbus. qt 4.8: dbus documentation. wiki: dbus. linux.conf.au.: Lennart Poettering. 19