Tuesday, 10 January 2017

IPv4 Subnetting

Let's talk about some IP subnetting! What is IP subnetting? To my understanding, it's a method to segment your network so you can use it more efficiently. Why do we need to use it efficiently? Because now IPv4 is becoming scarce, with lots of device that is able to connect to the internet, we need more than what IPv4 provided. The switch to IPv6 is going to happen, but it's a slow process to make sure everything is working when IPv6 is goes public and everyone and their grandparents, pets and what so ever can connect to the Internet easily. So what can we do to the current IPv4? We subnet it! What does it mean? It means we slice up the network reeeeaaaalll goooooood. Alright, before we start cutting stuff to pieces, we need to find how big we want the pieces to be, so we're gonna talk about how to find the IP range! Or maybe how to measure how big the pieces we want it to be :D

Say, you have an IP that looks like this: 192.168.1.3/30 , what in the world does that mean?! The first part before / should be familiar with you, that's an IP address, even if you aren't an engineer you should've seen it at least once in a movie or some error while browsing int the internet. Now the number 30, which is after the /, is not a part of the IP. "*GASP* WHAT IS THAT MAGIC NUMBER?! WHAT DOES IT DO?!" Relax, that's a subnet mask. Before, I mentioned that we need to know how big the pieces that we want to cut right? Well, that's the function of the subnet mask! So, how do we ACTUALLY slice up the network rreeeeeeaaaaaalll goooood? Now let's look at this!

192.168.1.3 = 1100 0000.1010 1000.0000 0001.0000 0011

30 = 1111 1111.1111 1111.1111 1111.1111 1100

---------------------------------------- AND

1100 0000.1010 1000.0000 0001.0000 0000 = 192.168.1.0

"Wow! The fuck is that mean?!" Hush, friend, let's dissect it step by step. First, you need to turn both the IP address and the subnet mask into binary numbers, and then you do an AND operation with both of them. You do know how to do the AND operation right? Nice! The result will give you the subnet of 192.168.1.3, so that IP address belongs to the subnet 192.168.1.0.

Okay so we know what the subnet is, but how do we know how big that piece of the subnet is? Alright, again, to my understanding, the subnet is also the first IP address in the subnet. So we got the first IP address of the subnet, and an Xth IP address of the subnet. Now, remember I said the subnet mask helps you know how big the piece is? Now it's time to use it! If you see the binary number of the subnet mask, you'll see there's a two zeros in it. That's what you use to find out how big the subnet piece is! Or the range of host that can be used in the subnet. So there're only two zeros right? What is the result of 2^2? Four right? Well that means there're four hosts in the subnet! So if you use other subnet mask, just turn them into binary numbers, then find how many zeroes you have, then power it to two (ex: 2^x of zeroes). But in our example, only two can only be used as a host for user.

So why only two host can be used? There's a thing called Broadcast IP address and Network IP address. What are those? Well broadcast address is the IP address that is used if you want to send something to all the host in the subnet, and the network IP address is the identifier for the network. Is this easy enough to understand? Well if not, I found some nice reference that can explain these two terms better than me here. But how do we know which one is the Broadcast IP address and which one the Network IP address? If you're using the power method, it's easy! The first IP address of the range is the Network IP address, and the last IP address of the range is the broadcast address. Simple right?

Alright, that is all that we need to subnet a network. A way to find the IP hosts range, broadcast IP address and network IP address then you should be good. All of this is good to plan the subnet on paper first, you still need to configure the real network in the end. Oh and your router at home won't be able to do network subnetting, because it's mostly used as access point to the outside network and can't handle several network in it. So either train with packet tracer or GNS3, but be mindful since there'll be some problem you might meet, or buy a REAL router which can handle lots of network! I totally not recommend this though, that shit is very expensive and tends to be marketed towards business. So, next up, I'll try to write a tutorial about subnetting in packet tracer, since I actually haven't succeed yet with subnetting in packet tracer too. So we're both gonna learn something new :D

Well then, I guess that's about all I can share today. Here's the reference for this tutorial, it's actually some summary from the reference, but I try to make it understandable to people who is not familiar with IT terms. And as always, this just my understanding about IP subnetting, I could be wrong in some part, so if you do find something wrong, I'm happy to correct it. Because knowledge is meant to be shared :). Then till next time :D

Last week of the Xsis bootcamp

Welp, I didn't expect to write about this stuff this late, but whatever.

Alright, last time I was busy with .Net bootcamp by Xsis, which in the second week I learned about SQL. At first, I thought SQL is something that's very convoluted, what with the test to get in the bootcamp wants you to join two table and show a certain value, but to my surprise, it was quite easy actually. We just need to select a few data and join them together, which is kinda fun but I always forgot we're not using CLI, but Windows server 2012, so the way to run it is not by pressing enter. Maybe I'll write about it sometimes, but probably I'm going to use MySQL for it, just because I miss using a terminal.

Now I did mention there's a test to pass if I want to continue the training right? Well that test took place in the 2nd of January. Let me tell you something, it took us by surprise. First, we got theory, which doesn't have lots of points but if you actually understand how to code, you're supposedly automatically understand it. Next, we got SQL query test, this too is a breeze since all of the materials is already covered in the bootcamp. Now, the logic test is something else, there're a few that is easy enough to do but the other is maybe hard. The test is open book, which mean we can use the code from the bootcamp to help doing the test. But unfortunately, I didn't pass the test.

Alright, alright, settle down, lemme tell you a few things before you morons jumps into conclusions. First, it's a fact that I didn't pass the test, whatever I say next could be seen as justification but it may shed some light as to why I didn't pass the test, so for god sake be a smart reader and read this paragraph, I know people like to take things out of context. Secondly, it was not because I didn't understand or not good with the logic, but rather I spent half of the time just staring at test thinking "where should I apply next?" After the afternoon break, the test actually became clear to me, then I start doing the easiest one, but neglect half of it. I don't know why I did what I did but that's what happen, do I feel regret now? A bit but I also feel a bit relieved. Finally, this maybe more of a justification of what I did but I felt that my parents don't actually approve me doing this bootcamp. Why? Because my father mostly asked me do I feel comfortable while in training, this maybe just my rebellious feeling but still it bugs me a lot. Not to mention, the first week of bootcamp I was lamenting of how this'll block my way to become a network engineer. Silly, I know but by the end of the week, I was snap out of it. I thought, maybe if I'm lucky, I'll get a project as a system administrator, or with the knowledge I got, I might get into network programming and maybe network security or something, the possibility is only limited by my imagination.

In conclusion...

I didn't pass the test, but they offer me a job in another division and a chance to redo the bootcamp in the next month. But for the time being, I didn't take the job opportunity because I need to consult with my parent first. I know, I know, another justification to run away but I do feel the need to consult this kind of stuff first with my parent. I know I'm not close with my parent but they still have the rights to lead me, and it's not a bad idea to have a second opinion too. And to quote what the head teacher of the bootcamp said, "There are people who just need two weeks to be trained, but there are also some that needs more than two weeks to be trained".

So what am I going to do now? Looking for job is probably what I will do most of the time, but being in the bootcamp actually rekindle my will to learn more. So, I guess I'm going to fulfill the promise of writing tutorials in this blog. "Yay! This fucking blog is not just some faggot whining anymore!" Yeah, sure, pop the wine, I'm gonna start doing some worthy stuff in this blog, not just me whining about life.

Enough about the whining and celebration, in the end, what do I get out of the bootcamp? A lot of things. I felt a bit matured after the bootcamp, when before I only see several ways to reach my goal, but now I see more ways to reach my goal. Not to mention, the C# training is also very helpful in shaping my mind about programming, and I got a new toy (read: C#) to play with! It is a very unique and useful experience, which I highly recommend if you got the stomach for it. Keep in mind, in bootcamp, all your life will be about programming, programming, programming, and programming, so if you're not up to it, I suggest you look for other way

In short, I got more than what I bargain for. So thank you very much for P.T. Xsis for the chance that you've given to me, and maybe if I still have the will, I'll retry the bootcamp next month. That's all for now, expect a new tutorial later. Bye!