You are here

Cryogenic

Cryogenic is a Linux kernel module that allows to reduce energy consumption by means of enabling cooperative clustering of I/O operations among the various applications that make use of the same hardware device. In order to achieve this target, Cryogenic provides an API that enables applications to schedule I/O operations on SCSI and network devices at times where the impact the operations have on energy consumption is small.

The schedule is enacted by means of two actions. The first action taken is related to the hardware's ability to enter a sleep state after being idle for a certain period of time. Although this sleep state has a lower energy consumption, resuming the activity of devices takes energy as well, and thus it is desirable to avoid unnecessary wake-ups, which may be caused by background applications that have periodic non-urgent tasks.

Non-urgent tasks may not only force devices to wake up, but also prevent them from going to sleep, since they may reset the timeout to enter the sleep state. Therefore, the second action taken by Cryogenic is to lengthen the duration of idle periods. This way, the overall consumption decreases and it is more likely that the device enters into sleep.

Design

Internally, Cryogenic defers (or anticipates) the execution of non-urgent tasks so that they coincide with the performance of I/O operations requested by other urgent applications. Therefore, background tasks operate when the device is already active and they do not need to wake it up by themselves. Moreover, tasks using the same device are ideally executed in a clustered way and, as a result, the idle periods become longer.

The actual moment when an I/O operation is performed is determined by a tolerance window set by the application developer. The window is defined by a minimum delay and a maximum timeout, which ensures that the task will not indefinitely wait for other I/O operations and starve as a result. The delay and the timeout must be properly calculated and set by the programmer, since they determine the application behavior and they are the key factor to trade-off between the responsiveness of the application and the energy it consumes.

The architecture of Cryogenic defines an API composed of:

  1. A character device under /dev/cryogenic/ for each targeted device
  2. Redefinition of the following system calls: open, close, ioctl, select

The character devices, managed by the system calls, determine whether a task can proceed with its operation. The call to iocl is used to set the delay and the timeout for each task, and select allows or forbids the execution of an I/O operation at a given time.

Usage

In order to see how to use the Cryogenic API, we present the following example:

main()
{
    sock_fd = create_socket();
    while() {
        send(sock_fd);
        sleep(period);
    }
    close(sock_fd)
}

This code is a simplified version of a UDP client that sends packets periodically. In order to apply Cryogenic to this program, we need to perform the following actions.

  1. Open the character device corresponding to the active interface that is sending the packets, which we need to know beforehand.
  2. Within the main loop, and before the transmission, calculate the delay and the timeout and pass it to Cryogenic by calling ioctl.
  3. Call select before the transmission. The call to select will block until one of the events that are meant to allow the resumption of the task happen: an I/O operation requested by other applications or the expiration of the timeout that we set previously.
  4. After the loop, close the file descriptor.

The resulting code looks like this:

main()
{
    sock_fd = create_socket();
    fd = open("/dev/cryogenic/wlan0");
    while() {
        times = calculate_delay_timeout(period);
        ioctl(fd, times);
        select(fd);
        send(sock_fd);
    }
    close(fd);
    close(sock_fd);
}

As we can see, the call to sleep() has been removed since we assume now that the delay and the timeout completely determine the transmission time. Nevertheless, this is just an example and programmers may still want to keep it depending on the behavior they want to achieve.

Source code

You can download Cryogenic's source code here. The file also contains the necessary makefile to compile the module, as well as test programs used for experimentation.

Video: Alejandra Morales Ruiz Master's defense on Cryogenic


The video Creative Commons License
Cryogenic: Enabling Power-Aware Applications on Linux by Alejandra Morales Ruiz is licensed under a Creative Commons Attribution 3.0 Unported License.

Learn more

If you want to know more about Cryogenic or see further examples of usage, you can download the Master's thesis here.

Read more Friday, March 14, 2014 - 18:50 Alejandra Morales

Video: Bart Polot on GNUnet CADET and GNUnet Conversation at YBTI/30c3

Here is the video of Bart Polot's talk at YouBrokeTheInternet/30c3 on "GNUnet Conversation". Note that somehow the title got botched to "GNU Telephony", which is simply incorrect as GNU Telephony is GNU's SIP replacement, and that is definitively not what the talk is about. This talk is about GNUnet's CADET routing and the GNUnet Conversation (voice-over-GNUnet) application that we are building with it.

Read more Tuesday, February 25, 2014 - 12:00 Christian Grothoff

Numerical Stability and Scalability of Secure Private Linear Programming

Read more Wednesday, February 19, 2014 - 13:57 Anonymous (not verified)

Video: Data Protection Day: "After Snowden: using law and technology to counter snooping"

On the occasion of Data Protection Day, Pieter Omtzigt invited Jacob Appelbaum, Douwe Korff and Christian Grothoff to testify on "using law and technology to counter snooping" at the Counsil of Europe (CoE). Peter Omtzigt is rapporteur for a report on "Massive eavesdropping in Europe".

Read more Friday, January 31, 2014 - 11:31 Christian Grothoff

Video: 30c3 talk on "The GNU Name System"

Here is the video of my talk (with help from Florian Dold) at 30c3 on "The GNU Name System". Sadly, the "Secure Name Systems" panel at the same venue was not recorded.

Read more Thursday, January 2, 2014 - 12:45 Christian Grothoff

Typo-Protected Public Keys

When users type in public keys (such as the 53-characters of a GNS zone), they might make typos. The usual way to fix typos is to add a checksum, further increasing the length of the sequence that has to be typed in.

We can fix this by including the checksum of the public key in the public key itself, simply by trying new private keys until the corresponding public key happens to have a checksum (over the other bits) in the bits designated for the checksum. If a checksum is 16 bits, we would only need to try 216 keys. The basic idea of brute-forcing keys to match a particular pattern was proposed before for creating "vanity" public keys, but this might be another practical variant.

Acknowledgements

The idea popped up in a discussion on the need for short public keys for GNS with Dan Bernstein and Tanja Lange at 30c3.

Read more Saturday, December 28, 2013 - 12:38 Christian Grothoff

Join GNS Key Exchange Party at 30C3 Hamburg

The GNU Name System (aka GNS) is a fully decentralized, censorship resistant naming system based on the idea of a pet name system not relying on centralized organizations. Every user manages his own namespace. To access names and records of other user's you have to exchange some specific information which can be done in a convinient way using a business card with a QR code containing your GNS information.

The Key Exchange Party

A congress like the 30C3 is the ideal place to exchange these information with your buddies in person. Therefore we provide you with all requirements for a convienent start using GNS.

After you installed and configured GNS with the records for your services, you can create your own business cards containing your personal information (or at least as much as you intend to give to other people) and even get a hard copy to exchange it with other persons! Other users can use your business card to automatically add your GNS records by just scanning the QR record on the business card using a standard webcam.

How to Participate ..

So basically you can meet the GNS developers at 30C3 at the HACAS assembly (https://events.ccc.de/congress/2013/wiki/Assembly:HACAS) and the YBTI Workshop (https://events.ccc.de/congress/2013/wiki/Assembly:Youbroketheinternet) ... You are cordially invited to join and come over for a discussion or a chat...
So the basic required steps are:

  • Install GNUnet and GNS
  • Setup your names and records
  • Create your business cards
  • Get a print out at Wau Holland Foundation, 30C3
  • Give them to other people
  • Add other people's information to your namespace

Installing GNUnet and GNS

GNS is contained in the GNUnet P2P framework. So the first required step is to install GNUnet in the latest stable version 0.10.0.

The required steps are explained here:
https://gnunet.org/generic-installation

Please be aware that only the latest stable will work, older version are not compatible! (No hoax: 0.9.5a will not work!)

To use GNS, you will also have to setup your installation for GNS, so you should follow the following steps:
https://gnunet.org/gns-namestore-editing

Setup your names and records (optional)

If you are hosting any services you want to make accessible for other users, you should setup the respective records in your zone. The most convenient way is to use the gnunet-namestore-gtk tool, a GUI to manage your namespace. If you prefer to use the command line tool to manage your records, check the link in the last section about setting up GNS.

Create your business cards and give them to other people

Now you are ready to exchange your information with your buddies.
The most convenient way is to create a set of business cards containing your information. We provide the GNUnet business card manager to create these business cards. To use the GNUnet business card manager, you need to have texlive-full on your system!

Just run gnunet-bcd and open the website http://localhost:8888

For your GNS information you need to extract the public key of your GNS namespace by running. You can copy it from the gnunet-namestore-gtk GUI or by running:

$ gnunet-identity -d $options | grep master-zone | awk '{print $3}'

For example, the output might be something like
DC3SEECJORPHQNVRH965A6N74B1M37S721IG4RBQ15PJLLPJKUE0.

The nickname field should be the proposed name other users would use to add your information to their namespace. This name is just a proposal and every can modifiy this name using the gnunet-namestore-gtk GUI.

After pressing the submit button, you can download a PDF containing your business cards with QR information. You can now give this business cards to your friends and colleagues...

Add other people's information to your namespace

When you received a business card with a GNS QR card you can easily add the GNS information by just scanning the code using the gnunet-qr tool. if your computer has a webcam you should see a window containing the video stream. Hold the card in front of the webcam and the code should be automatically recognized. You should see a message like:

Added URI gnunet://gns/Q821UVI8H4HD9TE8LID7QOB6P27SNJHPA3JM913B7IDSTJP9BLUG/docmalloc

If your computer does not have a webcam you can also import the link using

gnunet-uri gnunet://gns/Q821UVI8H4HD9TE8LID7QOB6P27SNJHPA3JM913B7IDSTJP9BLUG/docmalloc

You can double check the result in the gnunet-namestore-gtk tool. Now you are abled to resolve the user's names

How to Use it

One thing you can use GNS for, besides having name to IP address mappings, is to publish your GnuPG key to make it resolvable by your buddies.

To create a record for your GnuPG key, you just have to create a new CERT record containing your GnuPG key:
$ gnunet-namestore -t CERT -n "+" ...

Other users now can resolve your GnuPG key using
$ gnunet-gns -t CERT buddy.gnu

Read more Wednesday, December 25, 2013 - 11:25 Matthias Wachs

Pages

Subscribe to Front page feed