presentations

Presentations
Log | Files | Refs

clients (5817B)


      1 
      2 * Clients
      3 
      4 Clients implement a user interface for interacting with the PSYC network. They
      5 connect to the PSYC daemon and link with a person entity. After successful
      6 linking they receive all the packets destined for that person and can send
      7 packets originating from the person. In the current implementation of psycd no
      8 authentication is required for linking, so it's only suitable for localhost use,
      9 later we'll provide password authentication as well.
     10 
     11 We have developed a client library -- called libpsycclient -- providing a simple
     12 API for clients. It implements the core logic used by clients to interact with
     13 the PSYC network. It allows clients to establish a connection to psycd, so they
     14 can send and receive packets for their person entity. Clients can define
     15 callback functions for handling incoming packets and various events,
     16 e.g. handling linking and unlinking or adding and removing aliases. The library
     17 also provides various commands used in clients, such as entering and leaving
     18 contexts, sending messages, setting aliases, or querying and manipulating the
     19 context state.
     20 
     21 By using the client library, implementing new clients is much simpler. With the
     22 library providing all the underlying logic, client developers can focus on the
     23 GUI, implementing message display and UI elements performing various commands
     24 provided by the library.
     25 
     26 ** Desktop clients
     27 
     28 #+CAPTION: irssyc, a text-based client
     29 #+LABEL: fig:irssyc
     30 #+ATTR_LaTeX: width=14cm placement=[t!]
     31 [[./shot-irssyc-gray.png]]
     32 
     33 #+CAPTION: secushare, a GUI client
     34 #+LABEL: fig:secushare
     35 #+ATTR_LaTeX: width=14cm placement=[ht]
     36 [[./shot-secushare.png]]
     37 
     38 We have implemented two clients so far: a text-based client and one with a
     39 graphical user interface (GUI).
     40 
     41 The text-based client, irssyc (figure \ref{fig:irssyc}), is implemented in C as
     42 a module for Irssi, a popular chat client. It is more suited for advanced users
     43 and for development and testing purposes. It shows each subscribed channel in
     44 one of its windows and provides access to commands implemented by the client
     45 library.
     46 
     47 The GUI client, secushare (figure \ref{fig:secushare}), is implemented using Qt
     48 in C++. It uses Qt's relatively new declarative user interface (UI) description
     49 language, QML. The C++ part of the application implements data models used by
     50 QML components to display data -- such as the contact list or messages in a
     51 channel -- and provides access to the commands implemented by the client library
     52 from QML.
     53 
     54 The reasons for choosing Qt were its extensive platform support and its
     55 declarative UI description language, QML, which makes it easier to accomplish a
     56 complex but still consistent user interface with good usability.
     57 
     58 Qt supports most desktop operating systems -- including Windows, Linux and Mac
     59 OS X -- and a couple of mobile platforms as well: Maemo, MeeGo, Windows Mobile
     60 and Symbian. Recently it has been ported to Android as well, and there's an iOS
     61 port being developed, too.
     62 
     63 ** Web interface
     64 
     65 We have plans for developing a web interface as well, which allows remote access
     66 of a node installed on a plug computer or server machine. This is useful in case
     67 the user does not have a device available that runs a full node with the whole
     68 software stack. The web interface will be a PSYC client written in JavaScript,
     69 communicating with psycd via WebSocket. This way we only need minimal
     70 enhancements on the server side, as the client is pretty much like a desktop
     71 client in this case, only the connection to psycd is implemented
     72 differently. Now that JavaScript typed arrays are available in most modern
     73 browsers, parsing of binary packets are possible now purely in JavaScript.
     74 
     75 ** Mobile clients
     76 
     77 As all components of GNUnet are written in C, it is possible to port it to
     78 smartphone platforms. Problem with this approach, however, is that continuous
     79 network traffic drains the battery really soon, so we'll have to take measures
     80 to reduce network traffic. If the mobile node connects only to one trusted node
     81 -- e.g. hosted on a server or plug computer in the user's home -- which forwards
     82 the necessary packets for the mobile node, this significantly reduces network
     83 traffic, as the mobile node does not have to take part in any routing scheme,
     84 which usually means continuous traffic, even if it's low volume.
     85 
     86 Another approach is to only implement a client application for mobile devices
     87 which connects to a remote psycd on a trusted node over a TLS connection. This,
     88 however, requires users to set up a server or a plug computer at home and
     89 configure their firewall or NAT box to allow connections to the PSYC
     90 daemon. Advantage of the full node approach is that GNUnet already takes care of
     91 NAT traversal, it does not need to deal with (dynamic) DNS and TLS certificates.
     92 
     93 ** Extensibility
     94 
     95 Extensibility via custom applications is an important aspect of the system. We
     96 have two different approaches to achieve this.
     97 
     98 *** Channel API
     99 
    100 Channels can have an interface type defined in an =_interface= state
    101 variable. The default view is a chat interface, and we're planning to provide a
    102 few other built-in types in the secushare GUI client, e.g. a microblogging
    103 interface with status updates.
    104 
    105 We intend to enable developers to write custom applications on top of channels,
    106 which will run in a sandboxed QML or HTML view inside the client, using a
    107 JavaScript API for sending and receiving packets for the channel. This approach
    108 does not expose any private user data to the applications, as they only have
    109 access to the channel they're running in, and nothing else.
    110 
    111 *** Client API
    112 
    113 For more complex tasks custom client applications have to be built using the
    114 libpsycclient C library. This approach allows full access to user data and
    115 messages for the application, thus users should be careful what client
    116 applications they install on their machine.