Archive for 2010

29 March 2010

Hardware accelerated network monitoring: NetFPGA

NetFPGA

During my third year at Télécom Bretagne, I worked on a project with two colleagues to develop an hardware accelerated network monitoring tool using a NetFPGA. This low-level project was very interesting and made me discover how to develop directly in hardware using a language called Verilog.

To let you discover this project, I pasted below the abstract of our final report.

Abstract

The growing use of the Internet, with services like YouTube, Dailymotion or Peer-to-Peer, raises the demand for larger bandwidths continuously. This and the technological evolution leads to traffic which is becoming more and more important. With the increasing bandwidth, the observation and control of the traffic also needs to be accomplished at a higher speed. This new challenge is being encountered by using hardware implementations of monitoring algorithms.

During our third-year project at Télécom Bretagne we worked on such a hardware implementation using a NetFPGA, a PCI board containing an FPGA and four Ethernet ports. Starting with a simple Ethernet hub that we added to the existing structure of the NetFPGA, we continued with the implementation of a detection of TCP SYN packets. In order to count these SYN packets, needed for the detection of SYN flooding attacks, we used a special stream mining algorithm to reduce the memory needed : the CMS algorithm.

More information

Everything we did about this project is available online on the Trac of our project. The final report is also available (in French, sorry).

No Comments yet »

10 February 2010

Merge/split PDF files directly in Dolphin (KDE)

KDE logo

Context

I have just switched to KDE after using Gnome during many years, and I am quietly getting used to it.

But recently I had to merge 2 PDF files, so I searched for a good solution for KDE. There are many command-line tools to do this on Linux, but the few graphical interfaces are very ugly.

So I thought it would be great to integrate a merge/split PDF function directly in Dolphin, the KDE file manager. In dolphin when you right-click on a file, a menu pops up with a sub-menu “Actions”, where you can add your features. I will now explain how I did this.

Prerequisites

  • You need to be running a recent version of KDE (using Dolphin as your file manager). I have the version 4.3.5.
  • To manipulate your PDF files, you need a command-line tool, I chose pdftk. You can install the package pdftk on kubuntu, for example by typing in a terminal:
    sudo apt-get install pdftk

Create scripts to merge/split PDF files automatically

I created two scripts: one to merge PDF files, and the other one to split them. I put both files in the directory /opt/pdf-service:

  • /opt/pdf-service/pdf-service-merge.sh (download):
    #!/bin/bash
    # Run a command to merge PDF files
    # Used to add a context menu in Dolphin for PDF files
    
    pdftk "$@" cat output "${1%.pdf}_merged.pdf"
  • /opt/pdf-service/pdf-service-split.sh (download):
    #!/bin/bash
    # Run a command to split PDF files
    # Used to add a context menu in Dolphin for PDF files
    
    for file in "$@"
    do
       out_dir="${file%.pdf}_pages"
       mkdir -p "$out_dir"
       pdftk "$file" burst output "$out_dir/page_%04d.pdf"
    done

Here are the steps you need to follow to get these files properly on your computer:

  • Create the /opt/pdf-service directory: type in a terminal:
    sudo mkdir /opt/pdf-service
  • Download the two files in the directory: type in a terminal:
    cd /opt/pdf-service && sudo wget http://www.viesurip.fr/wp-content/uploads/2010/02/pdf-service-split.sh http://www.viesurip.fr/wp-content/uploads/2010/02/pdf-service-merge.sh
  • Make the files executable: type in a terminal:
    sudo chmod a+x /opt/pdf-service/*.sh

Add the service to Dolphin

A service in Dolphin is declared using a simple .desktop file in the directory /usr/share/kde4/services/ServiceMenus/: Here is the file you should put as /usr/share/kde4/services/ServiceMenus/pdf-servicemenu.desktop (download):

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/pdf
Actions=split;merge;

[Desktop Action split]
Name=Split PDF pages
Name[fr]=Découper les pages du PDF
Icon=gnome-mime-application-pdf
Exec=/opt/pdf-service/pdf-service-split.sh %F

[Desktop Action merge]
Name=Merge PDF files
Name[fr]=Fusionner les PDFs
Icon=gnome-mime-application-pdf
Exec=/opt/pdf-service/pdf-service-merge.sh %F

To install this file, just type in a terminal:

cd /usr/share/kde4/services/ServiceMenus && sudo wget http://www.viesurip.fr/wp-content/uploads/2010/02/pdf-servicemenu.desktop

Conclusion

Now you just need to close all opened windows of Dolphin, launch it again, and you should see the menu entries in the Actions submenu when you right-click on a PDF file.

The entries are only available in English and French in my file, but you can easily add another language in the pdf-servicemenu.desktop file.

It would be great to have an user-friendly interface to install packages that add useful submenu entries like that! Some sorf of Dolphin extensions…

2 Comments »

  • Welcome!

    I write on this blog about my projects, my practices and my discoveries in the domains of the internet, networks and computer science.

    Tristan, French student in TELECOM Bretagne, a "grande école" specialized in telecommunications

    Contact me Twitter Facebook

    Read more »