Showing posts with label debian_sid. Show all posts
Showing posts with label debian_sid. Show all posts

Sunday, April 26, 2015

Benchmarking unigine heaven on debian

In this article, we are trying something different, a good buddy of mine asking me to do graphic benchmark on linux system. So let's roll. Start by, downloading the benchmark application here at

This benchmark application size about 290MB, so while waiting for the download to complete, you should probably check if your graphic card has 3d driver installed and enabled. You can check by running in the terminal with the command glxgears, see screenshot below.


So make sure the gearing windows pop up or you will need to solve the problem shown in the terminal if it is not. Once the benchmark application is downloaded, you need to unpack and run it. See below.
user@localhost:~$ sh 
Creating directory Unigine_Heaven-4.0
Verifying archive integrity... All good.
Uncompressing Unigine Heaven Benchmark.............................................................................
Unigine Heaven Benchmark installation is completed. Launch heaven to run it
user@localhost:~$ cd Unigine_Heaven-4.0
user@localhost:~/Unigine_Heaven-4.0$ ls
total 16K
-rwxr-xr-x 1 jason jason 278 Feb 13 2013 heaven
drwxr-xr-x 4 jason jason 4.0K Feb 13 2013 bin
drwxr-xr-x 2 jason jason 4.0K Feb 13 2013 documentation
drwxr-xr-x 3 jason jason 4.0K Feb 13 2013 data
user@localhost:~/Unigine_Heaven-4.0$ ./heaven
Loading "/home/user/Unigine_Heaven-4.0/bin/../data/heaven_4.0.cfg"...
Loading ""...
Loading ""...
Loading ""...
Set 1920x1080 fullscreen video mode
Set 1.00 gamma value
Unigine engine
Binary: Linux 64bit GCC 4.4.5 Release Feb 13 2013 r11274
Features: OpenGL OpenAL XPad360 Joystick Flash Editor
App path: /home/user/Unigine_Heaven-4.0/bin/
Data path: /home/user/Unigine_Heaven-4.0/data/
Save path: /home/user/.Heaven/

---- System ----
System: Linux 3.9-1-amd64 x86_64
CPU: Intel(R) Core(TM) i3 CPU 380 @ 2.53GHz 2526MHz MMX SSE SSE2 SSE3 SSSE3 SSE41 SSE42 HTT x4
GPU: Unknown GPU x1
System memory: 7869 MB
Video memory: 256 MB
Sync threads: 3
Async threads: 4

---- MathLib ----
Set SSE2 simd processor

---- Sound ----
Renderer: OpenAL Soft
OpenAL vendor: OpenAL Community
OpenAL renderer: OpenAL Soft
OpenAL version: 1.1 ALSOFT 1.15.1
Found EFX Filter
Found EFX Reverb
Found EAX Reverb
Found QUAD16 format
Found 51CHN16 format
Found 61CHN16 format
Found 71CHN16 format
Maximum sources: 256
Maximum effect slots: 4
Maximum auxiliary sends: 2

---- Render ----
GLRender::GLRender(): Unknown GPU
OpenGL vendor: X.Org
OpenGL renderer: Gallium 0.4 on AMD REDWOOD
OpenGL version: 3.2 (Core Profile) Mesa 10.2.8
OpenGL flags: Core Profile
Found required GL_ARB_map_buffer_range
Found required GL_ARB_vertex_array_object
Found required GL_ARB_draw_instanced
Found required GL_ARB_draw_elements_base_vertex
Found required GL_ARB_transform_feedback
Found required GL_ARB_half_float_vertex
Found required GL_ARB_half_float_pixel
Found required GL_ARB_framebuffer_object
Found required GL_ARB_texture_multisample
Found required GL_ARB_uniform_buffer_object
Found required GL_ARB_geometry_shader4
Found optional GL_EXT_texture_compression_s3tc
Found optional GL_ARB_texture_compression_rgtc
Shading language: 3.30
Maximum texture size: 16384
Maximum texture units: 48
Maximum texture renders: 8

---- Physics ----
Physics: Multi-threaded

---- PathFind ----
PathFind: Multi-threaded

GPUMonitorPlugin::init(): can't initialize GPUMonitor
EnginePlugins::init(): can't initialize "GPUMonitor" plugin
---- Interpreter ----
Version: 2.52

Loading "heaven/unigine.cpp" 60ms
Unigine~# render_restart
Loading "heaven/locale/unigine.en" dictionary
Loading "core/materials/default/unigine_post.mat" 23 materials 50 shaders 34ms
Loading "core/materials/default/unigine_render.mat" 47 materials 2368 shaders 17ms
Loading "core/materials/default/unigine_mesh.mat" 5 materials 3386 shaders 15ms
Loading "core/materials/default/unigine_mesh_lut.mat" 2 materials 1062 shaders 4ms
Loading "core/materials/default/unigine_mesh_paint.mat" 2 materials 1158 shaders 8ms
Loading "core/materials/default/unigine_mesh_tessellation.mat" 5 materials 3332 shaders 15ms
Loading "core/materials/default/unigine_mesh_tessellation_paint.mat" 2 materials 2276 shaders 9ms
Loading "core/materials/default/unigine_mesh_triplanar.mat" 1 material 112 shaders 2ms
Loading "core/materials/default/unigine_mesh_overlap.mat" 1 material 300 shaders 4ms
Loading "core/materials/default/unigine_mesh_terrain.mat" 1 material 813 shaders 5ms
Loading "core/materials/default/unigine_mesh_layer.mat" 1 material 84 shaders 1ms
Loading "core/materials/default/unigine_mesh_noise.mat" 1 material 106 shaders 2ms
Loading "core/materials/default/unigine_mesh_stem.mat" 2 materials 2180 shaders 16ms
Loading "core/materials/default/unigine_mesh_wire.mat" 1 material 45 shaders 1ms
Loading "core/materials/default/unigine_terrain.mat" 1 material 1980 shaders 9ms
Loading "core/materials/default/unigine_grass.mat" 2 materials 474 shaders 5ms
Loading "core/materials/default/unigine_particles.mat" 1 material 109 shaders 2ms
Loading "core/materials/default/unigine_billboard.mat" 1 material 51 shaders 1ms
Loading "core/materials/default/unigine_billboards.mat" 2 materials 840 shaders 4ms
Loading "core/materials/default/unigine_volume.mat" 6 materials 53 shaders 5ms
Loading "core/materials/default/unigine_gui.mat" 1 material 82 shaders 0ms
Loading "core/materials/default/unigine_water.mat" 1 material 533 shaders 24ms
Loading "core/materials/default/unigine_sky.mat" 1 material 21 shaders 16ms
Loading "core/materials/default/unigine_decal.mat" 1 material 99 shaders 1ms
Loading "core/properties/unigine.prop" 2 properties 0ms
Unigine Heaven Benchmark 4.0 (4.0)Unigine~# world_load heaven/heaven
Loading "heaven/heaven.cpp" 152ms
Loading "heaven/materials/heaven_base.mat" 7 materials 10ms
Loading "heaven/materials/heaven_environment.mat" 13 materials 838ms
Loading "heaven/materials/heaven_ruins.mat" 27 materials 2101ms
Loading "heaven/materials/heaven_buildings.mat" 58 materials 2116ms
Loading "heaven/materials/heaven_props.mat" 10 materials 412ms
Loading "heaven/materials/heaven_sfx.mat" 11 materials 8ms
Loading "heaven/materials/heaven_fort.mat" 15 materials 544ms
Loading "heaven/materials/heaven_airship.mat" 26 materials 5176ms
Loading "heaven/" 13817ms
Unigine~# render_restart
Unigine~# video_grab
Saving /home/user/.Heaven/screenshots/00000.tga
Unigine~# video_grab
Saving /home/user/.Heaven/screenshots/00001.tga
Unigine~# video_grab
Saving /home/user/.Heaven/screenshots/00002.tga
Unigine~# render_restart
Benchmark running
Benchmark results:
Time: 261.689
Frames: 1286
FPS: 4.91422
Min FPS: 3.69493
Max FPS: 13.4421
Score: 123.789
Unigine~# quit
Close ""
Close ""
Memory usage: none
Allocations: none

This benchmark was performed on an OLD system, hence, score was very low. Otherwise, it ran fine, screenshots were taken and since benchmark is available for linux, I'm pretty sure more games will develop on linux. Come onbard on linux for better gaming experience. :) Enjoy the screenshots below.

unigine_heaven_benchmark_screenshot_0 unigine_heaven_benchmark_screenshot_1

Sunday, September 28, 2014

Learning getting ssl traffic using wireshark and analyze ssl traffic.

Today we are going to study ssl using trace from wireshark. As such, there are few efforts we will need to do and summarize as below.

  1. setup a web server that has ssl certificate configured.

  2. get the network traffic using wireshark.

  3. decode and analyze the network traffic using wireshark.

So first, what is SSL?

Transport Layer Security (TLS) and its predecessor, Secure Sockets Layer (SSL), are cryptographic protocols designed to provide communication security over the Internet.[1] They use X.509 certificates and hence asymmetric cryptography to authenticate the counterparty with whom they are communicating, and to exchange a symmetric key.

If you already have a web server with ssl certicate configured, you can skip step 1. This is the documentation which I used primarily. You may not succeed on the first attempt as it took me several attempts to get the ssl traffic decrypted.  Words of advice, just do not give up.

1. setup a web server that has ssl certificate configured.

With this, you can either get the certificate from an authority or you can generate one. If you do not know how, you can google or you can request in the comment, maybe in the future, I will write a simple one. But here, I assume you have the certicate ready.

In the web server, with apache httpd being the most common, edit the configuration file. In the apache directory, edit the ssl.conf. Example.
<apache httpd directory>/sites-available/default-ssl.conf

SSLCertificateFile /etc/apache2/sites-available/abc_cert.pem
SSLCertificateKeyFile /etc/apache2/sites-available/abc_private_key.pem

change to according where you place the certificate and its private key. Enable this site and restart apache httpd and then you are set. I won't go into details for troubleshoothing problem if you encounter as this is not the main focus of this article and should leave as an exercise.

2. get the network traffic using wireshark.

Make sure wireshark that is currently installed has GnuTLS compiled. You can check using command below. The output must have GnuTLS and Gcrypt available.
$ wireshark --version | grep GnuTLS
with GnuTLS 2.12.23, with Gcrypt 1.5.3, with MIT Kerberos, with GeoIP, with
1.6.1, with libz 1.2.8, GnuTLS 2.12.23, Gcrypt 1.5.4, without AirPcap.

Then now launch wireshark using root. Ignore about the warnings or information you receive during launch wireshark as root. Note, you can also using dumpcap when you need to capture in the server, but I have not verify if this solution is working. $ sudo dumpcap -i wlan0 -f 'host and tcp port 443' . Probably not because you need to configure the server private key and the client (browser) random key. That should leave as another exercise.
$ sudo wireshark

There are some fields black out for obvious reason, we want to protect the server and client. But it should be self descriptive when you complete the steps as mentioned here.

We will first configure section in ssl configuration so that wireshark will be able to decrypt the data traffic. As such, you will need the server private key, which you can get from step 1 above. To configure that, go to Edit then Preferences... see screenshot below.


A window from Wireshark: Preferences pop up. Now on the left menu, expand the Protocols in the tree and look for SSL.  See screenshot below.


First, we will configure RSA keys list. Click on the Edit... button. Then another window pop up. Now add the server key. There are four out of five fields you need to fill in. See screenshot below for final output. Here I will explain the fields.


IP addressThe IP address of the SSL server in IPv4 or IPv6 format, or the following special values: any, anyipv4, anyipv6, Put your server hostname or ip address if you know.
PortThe TCP port number, or the special value start_tls or 0. For web server, normally it run on port 443 and in this example, I gave port 443 because it is a remote server listening https traffic on port 443.
ProtocolA protocol name for the decrypted network data. Popular choices are http or data. If you enter an invalid protocol name an error message will show you the valid values. Because http data are encrypted using ssl, thus, we should put value http here.
Key Filepath to the RSA private key. So locate where you put the server private key at your local workstation and then select the file here.
Passwordonly needed when the private key is in format PCKS#12 (typically a file with a .pfx or .p12 extension). In step 1, the server private key is in format PEM and thus, for this field, you can leave it empty. Saved by clicking OK. Click on Apply and then OK.

The next field we are going to configure is the SSL debug file. This is a file written by this ssl module and I recommend you put a valid value here. You can tail this file later when the capture is started and you can inspect this file quickly (on the fly) when the decryption is happening. It is very good when your ssl decryption went wrong and this serve as a source of debug.

You should check the following fields.

  • Reassemble SSL records spanning multiple TCP segments

  • Reassemble SSL Application Data spanning multiple SSL records

Leave the field Message Authentication Code (MAC), ignore "mac failed and Pre-Shared-Key as is.

For the last field, (Pre)-Master-Secret log filename, fill in a value where in the next step, you will configure for the web browser environment. This is a file written by the client (web browser in our example) which is used by the client as a key to encrypt the data. Wireshark will read this file to decrypt the data.

That's it for the configuration, click on Apply button and OK button.

Now open another terminal and we will setup the environment so that client (browser) will dump the random key. Browser chromium will start to dump the keys to the file premaster.txt.
user@localhost:~$ export SSLKEYLOGFILE=/home/user/premaster.txt
user@localhost:~$ chromium

Now tail the ssl debug file and this premaster file in another two terminal tabs and watch the progress.

Right now, we will capture the traffic. To do that, click on Capture from the menu then Options... See the screenshot below. Set the configuration correctly, I check wlan0 because this is a laptop where the https request will flow to and fro within this channel. Capture filter, put on the host and the IP address of the web server where you configure in step 1 above. In this example, my server ip address is, so host


To start the capture, click on the Start button.

Now, trigger a https call to the server from the web browser (in this example, chromium) and watch wireshark capture and decrypt the https data! Check also the tabs in terminal when debug log and premaster.txt are rolling. Click on stop button when you are satisfy with the https request.

3. decode and analyze the network traffic using wireshark.

From step 2 above, you are now have a complete ssl dumped and it is decrypted! See screenshot below. You may have noticed that SSL data has another tab at the bottom know as Decrypted SSL data. In this screenshot, it is 9000bytes. Pretty awesome I must say.


Right click on the row of packet which has protocol TLSv1 and click on Follow SSL Stream. It will show the encrypted ssl traffic (https) which has been decrypted into a http traffic.

That's it folks. I hope you learn something and please visit on donation page to donate to us.