Cats
- arts (1)
- EvrythnElz (1)
- Fun (1)
- How2s (3)
- science (1)
In a previous post (Subnetting a network) I mentioned how we can subnet given IP address with mask into number of smaller networks. Now that we know how to do it we can actually move further and configure the layer 3 devices, such as routers, to maintain the traffic in this subnetted network.
Say we’ve got this schema to work on:
It is important to remember that we use ethernet crossover cable to connect hosts with routers, and straight-through cable to connect routers with routers. Hosts are connected through their FastEthernet interfaces and routers – with their Serial interfaces.
There are few ways to get Mac OS X styled docks in Linux. If we like them better, that is.
One way to do so is using the Cairo-dock application. Good thing about it is you don’t have to have compiz or any other render manager pre-installed (which is awesome, considering the fact that such managers of effects can really cause you headache if you’re running nVidia graphic card).
All commands below are for xUbuntu / Debian systems.
You can install Cairo-dock by:
Installing from .deb package or compiling from source would most probably ask you to install a bunch of additional packages and dependencies, that are listed in the CairoDock community site.
Once you’ve installed it you can start the docker by typing $ cairo-dock in terminal or from KDL launcher. Something similar should appear:
Themes and appearance can be managed through the Configure menu (right click on the docker). There are quite many options to chose from: position and styling of the panel, taskbar and icons effects, animation types, adding or editing desklets and many many more.
Adding applications to the docker is really simple – just drag and drop into the panel and voila. Removing ain’t much harder either – right click on the application icon in Cairo-dock and Kill or Remove this launcher, depending on the type of the app.
There might be some problems with OpenGL if you’re using it as Compositing type and if that is the case you can just launch the docker without OpenGL, which would solve the problem.
Традиционно в края на всяка година правим равносметка на изминалите събития, преосмисляме взетите решения или правим планове за нови. Класациите “Топ 10″ се превръщат в нещо съвсем резонно, имаме си мъже и жени на годината, дават се признания в различни категории. А когато края на годината оформя и завършека на едно десетилетие класациите стават още по-интересни – научаваме кои са десетте най-дорбри книги, най-интересни IT джаджи, най-красиви спортистки и най-невероятни космически истории на първото десетилетие от новия век.
През 2005 бе открита Ерис – планета джудже, по-голяма от Плутон. Всъщност година по-рано астрономите откриха други две по-малки джуджета - Хаумеа и Макемаке от пояса Кайпер, но именно Ерис накара Международния астрономически съюз да даде дефиниция на понятието планета и така Плутон бе понижен в джудже, изгубвайки мястото си на девета планета в Слънчевата система.
Here’s a joke, that my colleague, George, told me yesterday:
Two turtles are creeping the desert. No water around, sun is burning hot, thirst is killing them. Suddenly they see a canteen and run over, but it’s empty, so they move on.
A month passes by and they find themselves in front of a huge, beautiful oasis, full of water, trees and freshness. The first turtle says:
“Oh my, great! I’ll go back and grab the canteen we saw earlier. DON’T drink without me!”
“Fine, don’t worry. I’ll wait for you.”, says the other.
So the first one moves away and the second starts waiting. And waiting. And waiting.
A month passes by and she’s thinking “He must be there now.”
Another month passes by and she’s thinking again “He must be here any minute now..”
But he isn’t, so she’s thinking “I’ll wait another half month out of solidarity”
At one point, tired of waiting, she leans over the water and is just about to touch it with her lips (or whatever kind of mouth they have) as the first turtle jumps out of the bushes and shouts:
“Damn it! If we’re gonna be cheating I won’t even go!”
Tarja’s second show in Sofia – amazing as always and better than ever :)

It’s kinda funny how I believed her last year’s concert was one of the best I’ve been to, yet this year I was absolutely astounded by the beauty, endless energy and delight she spread among us one more time.

I totally lost my voice due to screaming and singing along, my knees still hurt cause of the jumping and I believe I clapped my hands off :) But man, it was sooo worth it !
The part she sang downstage, among the people – it was so amazing how she really made over 5 000 dudes fill the hall with silence and simply enjoy the beauty of her voice.
As a friend of mine said: Tarja and her band – nothing less than a triumph of music – there was classical music, there was metal, there was madness, there was intimacy, there was BEAUTY.
Sleeping Sun alive !!! Now I’ve seen it all
Now that it’s all over I can really say it was a dream come true. Can’t wait to “see” What Lies Beneath :)
Let’s try to make this easy.
Ok. In order to understand what lies beneath the main idea of sub-netting one should be familiar with the basics of binary arithmetic. Some knowledge in networks, ip addresses, subnet masks, interfaces and classes is required, too.
Suppose we are given the following IP address 192.168.157.0 /22 and we must use it to configure 8 (eight) subnets:
2 subnets having 2 hosts each (sn1 & sn2)
3 subnets having 60 hosts each (sn3, sn4, sn5)
1 subnet having 90 hosts (sn6)
1 subnet having 30 hosts (sn7)
1 subnet having 128 hosts (sn8)
It doesn’t usually matter which subnet would be the first to start with, but if there’s a requirement for lowest cost of hosts in a subnet (minimum number of hosts per subnet), then this should be the one with the maximum number of hosts within. That way we make sure we won’t waste too many IP addresses in the subnet, that are not needed anyway. (Try to keep in mind that 1 host = 1 IP address here).
So, following the logic from above we start with sn8, cause it has the greatest host number – 128.
Now, we could use the /25 mask for the subnet, cause 27 = 128 and that means all 128 addresses can fit into those 7 bits of the host part of the network address (see the picture below), BUT unfortunately it always has to be harder, right – we must actually take 8 bits, instead of 7, because there are 2 IP addresses in every network, that are preserved and cannot be used as host addresses – the Broadcast address and the Interface Address (which tells the router which interface to send the outgoing traffic through).
Here’s the picture and the explanation:
Taking the last 8 bits from the network address ensures that we’ll get 256 unique hosts in this subnet (28 = 256), which perfectly covers the need for 128 unique hosts + 2 preserved ip addresses. Yes, that way we sure waste 126 host addresses form the subnet (256-128-2), but were we to use 7 bits it would result in having only 126 unique host addresses (128 total – 2 preserved), which obviously doesn’t satisfy the condition.
So, the first subnet to configure is sn8:
It doesn’t really matter which of the subnet addresses is gonna be used as IA, but a good practice would be to always use the first available.
The next subnet to be configured should be sn6 – the one with 90 hosts inside (max to min). Since we msut supply 90 hosts (+2 preserved) we could use the /25 mask, cause 7 bits from the network address are pretty much enough to provide the needed number of hosts (27 = 128, which is bigger than 92). The mask is actually calculated very easy: the network address has 32 bits total, we take out 7 bits of it (so we can have 128 unique addresses) and we get 25 bits for the subnet address (32 – 7 = 25)
So, once again, sn6:
The next subnet to configure should be the three with 60 hosts (sn3, sn4 and sn5). We could use the same mask here (/25), but that would be a big waste of addresses in each subnet, because /25 means 128 unique hosts and we only need 62 (60 hosts + 2 preserved addresses). So we better use /26 mask – this means we will use the last 6 bits from the network address (26 = 64, which is just enough).
sn3:
sn4:
sn5:
Subnet sn7 must provide 30 HAs (+2 preserved), so we could use mask /27, because 25 = 32 (which is just about enough). This means we use the last five bits from the NA to determine the hosts and the first 27 bits to determine which subnet they belong to (32 – 5 = 27).
sn7:
The last 2 subnets must provide two unique hosts each. We cannot use just one bit to do this, because we still need to have +2 preserved (so each of the subnets should actually provide 4 unique host adresses). Since using 21 isn’t good enough we move on to 22, which is 4 – perfect. Using those 2 bits from the NA to determine the unique hosts leave us with 30 bits from the NA to determine the subnet. So the mask for sn1 and sn2 is /30
sn1:
sn2:
Usually subnets with 2 hosts are used for Layer 3 devices’ serial interfaces and the 2 hosts of the subnet are actually the addresses of the interfaces at both ends of the connection.
Here’s the complete transcription of the masks:
/24 – 255.255.255.0
/25 – 255.255.255.128 = 11111111.11111111.11111111.10000000
/26 – 255.255.255.192 = 11111111.11111111.11111111.11000000
/27 – 255.255.255.224 = 11111111.11111111.11111111.11100000
/30 – 255.255.255.252 = 11111111.11111111.11111111.11111100
To be continued
За да се схване идеята на събнета са необходими добри познания в областта на двоичната математика, както и поне бегла представа от мрежи, IP адреси, мрежови маски, интерфейси, класове.
Даден е адреса 192.168.157.0 в събнет /22.
С този адрес трябва да се конфигурират 8 подмрежи с изредения по-долу минимален брой хостове за всяка.
2 подмрежи с по 2 хоста (sn1 и sn2)
3 подмрежи с по 60 хоста (sn3, sn4, sn5)
1 подмрежа с 90 хоста (sn6)
1 подмрежа с 30 хоста (sn7)
1 подмрежа с 128 хоста (sn8)
Принципно няма значение с коя подмрежа ще се почне, но ако има условие за минимален разход на хостове при събнетването тогава по-хубаво е да се тръгне от мрежата с най-голям брой хостове към тази с най-малък. Затова в случая може да тръгнем от мрежата с 128 хоста (sn8 в условното означение).
Тънката уловка тук е, че освен тези 128 хост адреса, за подмрежата ще трябват още 2 – за broadcast (BC) и за адреса на интерфейса, който ще обслужва мрежата (IF). Така реално се получават 130 хоста, което значи че адреса на подмрежата ще има макса /24 (8 бита за хост адреси и 24 за определяне на мрежата).

Обяснение: заделянето на 8 бита гарантира получаването на 256 уникални адреса (защото 28 = 256, в които очевидно ще се поберат нашите 128 хоста от условието + BC + IF; ако заделим само 7 бита бихме осигурили 128 уникални адреса, защото 27 = 128, но в тях няма как да поберем 2та допълнителни)
Така се получава подмрежа с адрес: 192.168.157.0 /24.
IF адрес: 192.168.157.1
Хост адреси: 192.168.157.2 – 192.168.157.254 вкл.
BC адрес: 192.168.157.255
*Кой адрес от подмрежата ще се отдели за интерфейса е без значение, но за по-голяма прегледност и удобство е добра практика избора да се придържа към установени (собствени) правила – ако винаги слагаш първия възможен адрес от подмрежата за интерфейса, така няма да имаш проблеми и да се чудиш кое-как ако по-късно се върнеш на конфигурацията.
Следващата мрежа, чиито адрес трябва да се определи е тази с 90 хоста (sn6). При нея вече може спокойно да се заделят 7 бита (получават се 128 уникални адреса, в които се побират 90 хоста + BC + IF), т.е. маската е 32-7 = /25
Sn6: 192.168.158.0 /25 (мрежа 192.168.157.* вече е изчерпана, затова минаваме нататък)
if : 192.168.158.1
hosts: 192.168.158.2 – 192.168.158.126
bc: 192.168.158.127
Логиката натам е абсолютно същата: за мрежите с по 60 хоста могат да се заделят по 6 бита (26 = 64, в които влизат 60 хоста от условието и двата допълнителни). Маската за тези мрежи е 32-6 = /26
sn3: 192.168.158.128 /26
if: 192.168.158.129
hosts: 192.168.158.130 – 192.168.158.190
bc: 192.168.158.191
sn4: 192.168.158.192 /26
if: 192.168.158.193
hosts: 192.168.158.194 – 192.168.158.254
bc: 192.168.158.255
sn5: 192.168.159.0 /26
if: 192.168.159.1
hosts: 192.168.159.2 – 192.168.159.62
bc: 192.168.159.63
За подмрежата с 30 хоста (sn7) могат да се заделят 5 бита (25 = 32, в които се побират нужните 30 хоста + 2та допълнителни), съответно маската е 32-5 = /27
sn7: 192.168.159.64 /27
if: 192.168.159.65
hosts: 192.168.159.66 – 192.168.159.94
bc: 192.168.159.95
Останалите две подмрежи (тези с по 2 хоста) могат да се определят чрез заделяне на 2 бита (22 = 4), тогава маската е 32-2 = /30.
sn1: 192.168.159.96 /30
if: 192.168.159.97
hosts:192.168.159.98
bc: 192.168.159.99
sn2: 192.168.159.100 /30
if: 192.168.159.101
hosts: 192.168.159.102
bc: 192.168.159.103
*обикновенно подмрежи с 2 хоста се разпределят за серийни интерфейси, при които всъщност двата хост адреса са адресите на интерфейсите в двата края на връзката.
Пълното изписване на маските е:
/24 – 255.255.255.0
/25 – 255.255.255.128 = 11111111.11111111.11111111.10000000
/26 – 255.255.255.192 = 11111111.11111111.11111111.11000000
/27 – 255.255.255.224 = 11111111.11111111.11111111.11100000
/30 – 255.255.255.252 = 11111111.11111111.11111111.11111100
Целият пример е базиран на упражнения от Cisco Academy.
to be continued…