ZyXEL GS1910-24 Managed Gigabit Switch Review

A short time ago, I decided to install servers in a rack at my home. Although working very well, my 3Com managed was too much noisy for being at home. That is why I decided to change it for fanless switch. After some research, I finally chose a ZyXEL GS1910-24. It is a web-manageable gigabit switch. I chose the 24 ports version. This version has also 4 SFPs that replace 4 normal ports if enabled. I don't think I will ever need the SFPs, but it is nice to know that there are here if necessary. This switch has a lot of cool features, it supports IPV6, QoS, VLANs, filtering, RADIUS and so on.

The package

The package does not contains a lot of things, but does contain the essential:

  • The switch itself
  • A power code
  • Rack mounting brackets and screws
  • Manuals

Here is a picture on the package:

2013-07-11 16.51.47

The switch is really small, twice narrower than my 3Com switch and more than twice lighter.

Nothing special to say about the package, it is neatly done and has everything that is necessary.


The installation inside a rack is really easy. Each bracket is mounted with 4 screws onto the switch and then two screws are holding each bracket into place in the rack. Here is a picture of the rack:

2013-07-11 17.07.00

Once you put the power cord, it directly starts up and everything already works fine. The state of each port is represented by a led. Orange indicates a 100Mbit/s connection while green indicates 1Gbit/s connection.

The switch does not make a single noise and does not vibrate, it is really good


The easiest way to configure the switch is to use the web configurator. By default, the switch IP is As my router had the same IP, I had to disable it temporarily before changing the IP of the switch.

The web configuration is very complete, you can change absolutely everything from here. You have also access to a lot of monitoring tools from here. The most useful being of course the port monitoring interface:

Port Monitoring

I recommend changing the default IP address and the server password as first things on the switch.

I won't make the list of everything that is configurable on this switch, but the list is pretty impressive.


I'm really impressed by this switch. The switch is highly configurable and seems to perfectly fit my need. I would totally recommend this switch for rack installation at home. You can also totally use it as a desktop switch if you needs for a big switch on your desktop too

Home Server Adventure - Step 1

For years now, I've almost always had a server running at home. First it was an old desktop computer and then it was a QNAP NAS. The problem with the QNAP is that it is not fast at all and not as flexible as I would like it to be. Moreover, I was also running a Teamspeak server on my desktop for when my friends and I were playing together. So I decided to first install a simple server to replace my teamspeak server and I would services of my NAS with my new server. But this time, I decided to go for the complete option: A 19" rack :)


So I bought all I needed to install my 19" rack at home. I bought everything already used on auctions on Ricardo/Anibis (Switzerland Ebay equivalents) and Ebay. Here is what I got:

  • A 19" inch rack with 40 HE of the mark GURTNER + SCHNIEPP AG
  • A old Dell Poweredge 1850 server
  • A 8-ports Compaq KVM switch
  • A monitor/keyboard console for administrating the servers
  • A 3Com managed Gigabit switch

I got that for less than 500$. It is probably possible to get a similar configuration for less than that in the United States.

Here are some pictures (sorry for the poor quality):

2013-07-05 17.58.32

2013-07-05 17.59.23

For now, it is kind of empty. I will also put my NAS and my internet provider router in the rack in the future.

A this time, the cables are not very good organized, I will try to purchase some guides to make that look better and I will also try to find a rack PDU to distribute power without cables everywhere.

I also need to find two 120mm fans for the top of my case to improve air circulation. Very quiet 120mm can be found, so noise won't be a problem I think.

In the future, I also plan to find an UPS, but they are very expensive, so I will continue looking at auctions for them. The problem being that the battery should not be too old.


Of course, I've installed Gentoo on the server. At first, I wanted to install a Gentoo Hardened distribution with Selinux, but it turned out that it was too much of a hassle. After more than 10 hours of trying to make it work, I started again and in less than two hours my Gentoo installation was working. I will probably try again in the future, at least to harden the server and I hope it will go with less problems. The server is of course gui-less, only console access is more than sufficient.

For now on, I have only a Teamspeak server and a Mumble server installed on the server, but I plan to add new services on it, Sabnzb for instance.

I also installed iptables to add some layer of protection, even if I don't think that it is necessary in my case.

Finally, I used dyndns to map my public ip to a domain name to make it easier to reach. For now, I haven't installed an update client, but I plan to try ddclient.


I made some mistake when choosing the components for my installation. First of all, they are too noisy. The server and the switch are a real problem. They are both made for professional installations. Generally 1U server have very small fans (40mm generally) which are very noisy. So I decided to upgrade my configurations with two changes:

  • I will buy a fanless switch, probably unmanaged. They are plenty of very good fanless switches, even managed one for a reasonable price. I will try to first find a used one on auction, but I may consider buying a new one, as there exists some for about a hundred dollars. 
  • I will replace the Dell server with a custom server. I found some very good cases made by Norco. I'll buy a Micro ATX motherboard and install my old computer configuration (the one I had before) on it. It won't cost too much I think, although much more than the 30$ Dell server I have now ;)

The other problem being that the Dell server is too deep for my rack, so I can't close the back part as you can see on the pictures, but replacing it with the Norco case will solve the problem :)


It might sound crazy to have a complete rack at home, but I thing that it is a great way to experience with servers and network. It is also quite practical if you plan to have several servers.

I plan to post some posts on the subject on the future, so I hope  that it interests some people.

Why and how I completely left Windows for Linux

For years now, I always kept a dual-boot at home with a Linux system (currently Gentoo) and a Windows system. At work, I only use Gentoo. This week-end, I decided to completely remove it and migrate the applications I used on Windows to my Gentoo system.

Why Windows ?

So first things first, why was I keeping the Windows system ? For several reasons:

  1. Games :) Unfortunately, most of the games I play are not natively compatible with Linux.
  2. Office. I always liked Microsoft Office. As I hate OpenOffice/LibreOffice, I never wanted to remove it For schools we always had several teachers forcing us to use Microsoft document formats.
  3. Hardware support. I always found that hardware support in Windows was great. Most of the time when you add new peripheral, there is nothing, it just works, which is great.
  4. Applications. I always had some applications that I didn't found good enough Linux equivalents for. For instance, Newsleecher, iTunes or TaggedFrog.

On the other hand, I work on Linux for years now and I would like to have to work on Windows again.

What Changed ?

This weekend I upgraded my hardware configuration (Motherboard, CPU and RAM). I was afraid that I had to reinstall my Linux configurations (because of Gentoo compiled with march=native), but I never thought that I would have to reinstall Windows. I turned out the contrary: my Gentoo installation worked just fine and my Windows totally crashed (BSOD at each startup). I finally made it through Windows after disabled AHCI mode on my motherboard, but then activation was invalidated (of course...) and online activation was not working. I decided to install the new chipset drivers and launch the Windows update and after that, Windows decided to boot without any USB support (WTF...). After that, I decided that Windows what not so great at all for   hardware support...

Another reason I left Windows is Windows 8. I find that Window 7 was really great, but I really don't like Windows 8 and I would never have upgraded my Seven to it. Moreover, I recently bought Microsoft Office 2013 and it turned that I had to create an account at Microsoft to install it... Seriously ??? And moreover, it turned out to be worse thant Office 2010 (which, again, was great).

So all these reasons made me remove Windows.

How to migrate everything to Linux ?

First, I had no problem with my data. Most of my data are on a personal NAS and the remaining is on Dropbox, so no problem on this side.

I still had some problems to resolve. First of all, I needed my games to run on Linux. I currently play only Diablo III. As I had received a year free of Crossover, I decided to give it a try. Crossover is based on Wine and ensures that some software are running correctly under it and provide technical support. After some tuning, Diablo III was running almost flawlessly on my Gentoo machine :) Problem 1 solved. I will totally buy a license of Crossover, once my free year is over.

I still add some applications to replace. I use iTunes as my main music player and library manager. Some time ago, I tried a lot of programs like Amarok/Rythmbox/Banshee, but I didn't liked them a lot and they were not running very well on large library of music files. This time, I tried Clementine. Even if not very beautiful, it had all the features I needed and worked very well. I decided to stick with it. Another program I like a lot on Windows is TaggedFrog. It is a very simple program allowing to put tags on any file on the system and then search by tag on them. I haven't found a total equivalent. I first tried Tracker that is a Gnome project, but I was not satisfied with the search interface. After that, I tried the very simple TMSU. It is a command-line based tagging manager. All the tagging must be done in command line. In my case, it is not a problem, as I don't mind using the command-line and I don't tag files very often. What is very interesting about TMSU is that it can create a virtual file system (based on FUSE). In this file system, you have all your tags  as folder and you can see directly all the files of each tag. Moreover, you can directly make cross search (has tag X and Y and Z) by just going down in the tag folder. It is really great and has everything I needed. Finally, I also needed something to replace Newsleecher. I haven't found something as great (especially no replacement for the Supersearch function), but I installed Sabnzbd which works really well and is very simple. For now, I just use the web interface and haven't installed any other front-end, but that will perhaps change in the future.

I haven't replaced Office for now on. It occurred to me that since I left school, I haven't used it a lot, so that will probably not be a problem anymore. I will change to write the few letters I have to write on Latex and if I have Office documents, I'll probably read them on Google Drive.


Even if I lost a lot of time with all that, I think it is a great think. It makes one less configuration to maintain and some less costs on the future. Moreover, I will save some time, because I won't have to switch between Linux and Windows for different tasks. And now, I have a second SSD ready for something else, either for RAID 1 to ensure redundancy on Linux or to mount on a server, I'll see later.

I will probably have some more problems in the future, but I'm convinced that there will be Linux solutions to it :)

Improving eddic Boost Spirit parser performances

After the last changes on the data-flow framework, the parsing pass of the eddic compiler became the slowest one. I was sure there was some area of optimizations, so I decided to improve its performances.

In this post, I will present the different techniques I applied and their results.

Static grammar

The first optimization that I tried was to make the grammar static, meaning that we can declare it static and it will be constructed only once and will be allocated on the data segment.It is indeed heavy to build the lexer especially but also the grammar. I would like to thank sehe for this optimization, he found it after I posted a question on Stackoverflow.

The lexer was very easy to make static (only add static keyword :) ), but the parser was a bit more complicated because it needs the lexer iterator to get the current position in the file. This problem has been resolved by saving the iterator into the qi::locals of the rules.

The result of this optimization are amazing. It saved 33% of the time.

Expectation points

Expectation points have the interesting point that they disallow backtracking and so can improve performances in some cases. Moreover, they are always interesting because they make the grammar clearer and the error messages much better.

I tried adding more expectation points to the grammar. Unfortunately, there weren't a lot of them to add. Moreover, it seems that there are some quite weird behavior with them because some times it is impossible to add them (causes compilation failure) and sometimes it just make the code don't work anymore the same way, though I don't understand why.

Anyway, I have been able to add some to the grammar. These changes improve the performance by a bit more than 1%. It is not a lot, but it is still an improvement. Moreover, I'm quite sure that there are more expectation points that can be added to the code. I will take some time again later to try to add more and to understand them better.

Less skips

In my grammar, I've a special parser for getting the current position in the file to add "debug information" to the AST. This special parser was skipping over its content, but it has no content, since it is artificial. Removing it improved the performance by about half a percent.

Improve Position (debug information)

As said before, there is a special parser to get the current position in the file. This information is then stored into an eddic::ast::Position structure. This structure was holding the line number, the column, the file name and the contents of the line. The first two were ints and the last two were std::string. Each time, a copy of the strings were necessary.

I avoided storing the std::string directly by storing only the number of the line as well as the index of the file. Then, the content of the file is stored in the global context and can be accessed if it is necessary to display the line where the error happened.

This change gave an increase of 10% of the parsing performance.

Auto Rules

Rules in Boost Spirit have an overhead due to the cost of the virtual calls that are necessary. In theory, auto rules can improve the efficiency of the rules by removing the cost of virtual calls. Moreover, auto rules should also avoid code bloat when the rules are compiled. The rules can be inlined and better optimized.

I transformed some rules to auto rules to improve performances. Unfortunately, I found that this did not improve the performances. Moreover, transforming some rules to auto rules made the performance worse. I still did let some of the rules as auto rules. I have to say that I was very disappointed by this result, I was really expecting more from this :(

Generated Static Lexer

The first time the lexer is used, it has to generate the Deterministic Finite Automaton (DFA) that is used to identify the different tokens. This process takes time. There is way to avoid this by using the static model of Boost Spirit Lex. With that, the code is generated with the complete DFA and then it doesn't have to be initialized again.

I was not expecting a lot from this because the lexer was already static and so was initialized only once. Indeed, it resulted in less than half a percent improvement.


Even if I've been able to largely reduce the overhead of the parsing by more than 40%, it still has a big overhead. Indeed, it still represents 36 percent of the whole process of compiling a source file. I think it is still too much.

Moreover, an interesting fact is that the optimization I would have thought to be very effective (auto rules especially) did not have the expected effect, but making the grammar static, which I would not have thought of, was very effective.

When profiled, the final version shows that quite some time is spent in destructing the multi_pass, which is quite odd. And it also seems that transforming the string operators to ast::Operator is not very effective, but I do not know how to improve that at this point.

I won't probably work on that again for the version 1.2.4 of eddic, but I will eventually take some time again for the version 1.3.0 to improve it again.

Some news

No, I'm not dead ;)

After having finished my Master thesis in March, I took a break from my personal projects including this project. I then started a job in my school, waiting for a Ph.D thesis. I'm now working on a very interesting Machine Learning project about Speech, unfortunately in Java ;)

I just started again working on eddic this week. I'm gonna try to improve as much as possible the performances of the parser. I will also try to post again some articles on this blog, although I don't know about what.

eddic 1.2.3 - Better data-flow analysis

I finally finished the version 1.2.3 of eddic. I have been quite busy finishing my master thesis in february and then taking some vacations in United States, so this version came later than I wanted.

The main change is about the speed of the data-flow optimizations. I refactored a lot the data-flow to make it much faster. Some test cases are up to 10 times faster :)

There are still some work to do for speed of optimizations, but it is much better now. Dead Code Elimination and Constant Propagation still have to be made faster, but now the main bottleneck. In the next version of eddic, the parsing performance will be improved.

Inlining performance has also been greatly improved. The functions are considered in topological order of the call graph. This makes it much faster and moreover the resulting code is more efficient too.

There are also some improvements of the language. char and bool types now takes only one byte each. Copy constructors for structures containing field of structure type are now automatically generated. The grammar has been enhanced to support postfix operations in for loops.

Other improvements have been made to the optimization engine. A new optimization has been implemented: Loop Unswitching. This optimization transforms a code like that:

for(int i = 0; i < X; ++i){
    } else {
        //Something else

In some code like that:

    for(int i = 0; i < X; ++i){
} else {
    for(int i = 0; i < X; ++i){
        //Something else

when a doesn't depend on the loop body. The body of the loops is much faster in the second version.

The induction variable analysis is now able to handle loops with induction variable divided in each iteration. With that new feature, the call:


is reduced to


Another small optimization is that variables contributing only to themselves are now correctly identified as dead.

On the compiler side, the timing system has been greatly improved to contains almost all part of the compilation process. The timings for the complete compilation is available on the wiki.

Future Work

The next version of the EDDI compiler (eddic) will be the version 1.2.4.

Performances will stil be focused for this version. The first change will be to improve the performances of the parsing. Then, I'm gonna try to improve register allocation performances by improving handling of bound registers which I believe is a bottleneck.

There are also several refactorings that I think of doing to the code. I will probably also implement new minor language features, but I still don't know what.

Moreover, I have to serve in the army the next three weeks, so there won't be any progress these weeks.


You can find the EDDI Compiler sources on the Github repository: https://github.com/wichtounet/eddic

The version is available in the v1.2.3 tag available in the GitHub or directly in the master branch.

eddic 1.2.2 - Performances, improved optimizations and additions to standard library

These last weeks, I had more work than expected with my Master thesis so it took me longer to finish this new version of eddic. Moreover, I included more stuff than I though in this version. Anyway, I'm happy to announce the version 1.2.2 of eddic.

It is a minor version regarding the language itself. On the other, there are a lot of changes in the compiler itself.

For the language:

  1. Structures are now correclty copy constructed when passed by value
  2. When the same header is included several times accross the program, it is not parsed again
  3. The vector structure has now functions to insert and remove elements in arbitrary positions
  4. The functions to print bools, floats and integers are now written in EDDI directly. Only the functions to print chars and raw string are now written in assembly

I worked on improving the performances by improving the constant propagation pass that runs less times now and by tuning a bit the data-flow framework, avoiding virtual calls.

Another improvement is that all the mtac::Statement types have been merged in mtac::Quadruple, this removes one level of indirection and simplifies several passes. Moreover, there are now directly stored inside a vector and not allocated via shared_ptr. This removes another level of indirection.

Put together, these two optimizations improved the performances of the compiler by about 15%. On the other hand, now that printF and printI are written in EDDI, it takes much longer to compile. I will work on that for the next version too. One way to improve the performances will be to tune the ordering of passes and also to tune the passes themselves so that they do more work at once. I will also try to merge constant propagation and offset constant propagation together. They perform very similar work.

There are also several improvements in the optimization engine:

  • The loop analysis has been fixed to handle loops bigger than one basic block. There was a problem in my implement of Lengauer and Tarjan making that dominators were not computed.
  • The optimization engine now create a call graph of the program. This call graph is used to remove unused functions that are called but not reachable from the main function.
  • A new analysis pass has been added: pure_analysis. This pass test if a function is pure (no write to pointers or global variables) and thus avoid creating a basic block for it
  • The Loop Invariant Code Motion algorithm has been improved to handle more invariants
  • The Common Subexpression Elimination algorithm has been improved to handle more expression
  • The Induction Variables analysis has been reviewed and several bugs have been corrected. It is now a bit complicated.

A big bug has been fixed in the handling of the MEMSET LTAC instruction. This will be completely reviewed in the next version (See Future Work).

Some analysis starts to become quite complicated. I'm thinking of using SSA in MTAC in order to simplify some of the passes and to easily compute ud-chains. Another thing that I'm thinking is to add a powerful and complete alias analysis that would really improve the efficiency of some passes (offset constant propagation for instance) by making them less conservative.

I also have removed some memory leaks (will try to remove all of them in the next version). I added a new optimization level: O3. This level enables loop unrolling and complete loop peeling.

Future Work

The next version of the EDDI compiler (eddic) will be the version 1.2.3. The inliner will be improved to work directly in the call graph in postorder. That should produce better code. I will also try to improve the inlining heuristics. A first basic version of loop unswitching will be added as well. I will add a small local constant propagation pass for globals. I will also continue to work on the performances of the passes to avoid repeating them too much. MEMSET will be completely reviewed. That should produce smaller and faster code. Until now, the sizes of the types bool and chars were the same as int. They will be optimized to take only 1 byte.

I will also continue the improvements of the data structures by merging all ltac::Statement into ltac::Instruction and storing them directly.

And there will probably be some bug fixing as well.


You can find the EDDI Compiler sources on the Github repository: https://github.com/wichtounet/eddic

The version is available in the v1.2.2 tag available in the GitHub or directly in the master branch.

eddic 1.2.1 - string, concatenation and vector

Before preparing myself for New Year's Eve, I decided to finish eddic 1.2.1, and it's done !

This version is a small one, but add several improvements to the language and to the standard library. Many bugs have been fixed especially in the support of dynamic arrays and structures.

The first important change is that string has been renamed to str and that a new struct is available: string. Indeed, str is now a simple raw string where string has more capabilities like concatenation. This new version also supports concatenation of string and int, which was not possible before. In the future, I'll try to add more features to the string class.

Another improvement of the standard library is the inclusion of a vector structure. The vector is a dynamic arrays, which means that it can be automatically resized when necessary. For now, the operations available on vector are very few, but more will be added later. Especially, it is not possible now to add elements in the middle of the array, but it will be done, perhaps in the next eddic version or the next after this one. Adding the vector has also meant to add new features to the language.

Dynamic arrays of structures is now supported. And, the delete operator can be applied on any left value now, not only variables. It means that "delete a[9];" is now a valid code.

Finally, in the side of the language, printB has been rewritten in EDDI instead of raw assembly. In the next versions, I will continue to rewrite as much as possible of the assembly stuff into EDDI. There are several advantages. The first one is that I don't have to maintain two versions (one for 32 bits and one for 64 bits). Another advantage is that it can profit from the eddic optimizations. And it is more readable and maintainable in EDDI.

A new optimization is now available. If a function is always called with the same value for one of its parameters, the value is propagated inside the function. In the future, it will be improved to suppport propagation for instance in more than X% of the case, creating several versions of the function. The optimizations have also been a bit improved in terms of performance, making some samples much faster to compile than before. Essentially, the removal of dead basic blocks is now made in a way that it doesn't need to be run several times to remove all the dead basic blocks.

The warnings have been improved. Now, no warnings are emitted if some parts of a include are not used. And, if no elements of an included header is used, it will be warned that the include is not necessary.

The error reporting has also been improved a bit. It can now display several errors. For now, it is limited to one error by function. Doing better error reporting, would mean lots of changes in the AST passes which I don't want to do right now.

The hangman application has been fixed. It was a bug in the inliner that was causing this problem. There are now new test cases that verify that the optimizations are done. For instance, there is a test case verifying that the correct loops are removed when necessary. This is done by keeping tracks of counters like removed functions during the optimization.

The source code has also been improved. I now use less shared_ptr and rather rely in storing the elements in standard container and using references directly. It result in much better code. This also improves a bit the performances by having a better data locality. For now, I have handled the given classes: eddic::Function, mtac::Function and mtac::Program, but the next version will handle more critical structures like the basic blocks and the MTAC statements which could improve the performances of the optimization by making iteration faster.

Don't hesitate to comment or to contact me if you have any suggestion (or other) about this release or for the future versions of eddic.

And happy new year !

Future Work

The next version of the EDDI compiler (eddic) will be the version 1.2.2. In this version, I willl continue the work that I've done by using less shared_ptr and relying on references. I will also continue to improve the interfaces of the different class used. This version will also fix the memory leaks that I spotted in the application. There will also be new improvements on the language side, but minor one and I don't know now which ones I will pick.


You can find the EDDI Compiler sources on the Github repository: https://github.com/wichtounet/eddic

The version is available in the v1.2.1 tag available in the GitHub or directly in the master branch.

eddic 1.2.0 - Single inheritance, copy construction

I'm happy to release the version 1.2.0 of the EDDI Compiler (eddic).

This new version introduces several major changes to the language.

First of all, structures can now inherits from another structure. When it is done, the structure can use the members of the parent class. Below is an example of single inheritance in EDDI:

struct A {
    float a;

    void init_a(){
        a = 55.2;

    void test_a(){
        a += 1.1;

struct B extends A {
    char a;

    void init_b(){
        a = 'B';

    void test_b(){

For now, the support remains basic, but it will be improved over time. I will probably add support for virtual functions in the future.

Another major improvement to the language is that variable of a custom type can now be assignment, resulting in a call to the copy constructor. If no copy constructor is defined in a structure, it is automatically generated by the compiler. Another improvement to structures is that structures can now contains arrays. Moreover, the members of a structure (fields, constructors, functions, ...) can now be present in any order.

A major change has been made to pointers. The conversions from variables to pointers is no more implicit, it is necessary to use the new & operator to take the address of a variable. I found that this implicit conversions was not really making any sense.

A function can now return a structure by value. And, member functions can be called from any valid left value. For instance:


is now valid code.

Finally, the switch construct can be used with strings too. This uses the str_equals functions to test which case is valid.

There are no big changes in the optimization engine. A new optimization pass has been added performing loop unrolling for loop with known iteration count. The pointer propagation has been fixed to handle pointers on structures resulting in much better code for several samples. The last improvement here is that conditions can be propagated into branches when necessary.

The loop analysis has been improved to directly calculate the number of iterations of each loop and store this result. The list of induction variables is only calculated once now.

The code generation has been slightly improved by saving fewer registers when calling another function.

Finally, there are also some internal changes. The template instantiation depth limit can now configured. Before, infinite template recursion would just fail. The time spent in each optimization can now be computed with the new --timing option. There have been great improvements on the side of the Abstract Syntax Tree. A good part of the expression grammar has been rewritten. With these changes, the grammar is much more powerful than before.

Don't hesitate to comment or to contact me if you have any suggestion (or other) about this release or for the future versions of eddic.

I'd also like to thank TyRoXx who has made some improvements in the assembly generation module.

Future Work

The next version of the EDDI compiler (eddic) will be the version 1.2.1. This version will specifically focus on two points. First the usage of strings will be improved with a string class adding features to literal string. The second point will be the performances of the compiler. At this point, the optimization engine is clearly too slow. I will try to make it faster. The list of issues is available on Github.


You can find the EDDI Compiler sources on the Github repository: https://github.com/wichtounet/eddic

The version is available in the v1.2.0 tag available in the GitHub or directly in the master branch.