Sunday, November 29, 2015

Week 12: Day 034 - TCP/IP Basics #5


Hello everybody! Welcome to the entry that will be the second to last in this long chapter. If I'm posting this on Week 12, you might be surprised, because right now it's break, and I've decided to actually spend time on this. But, it's the end of my much needed break, and I feel like I'm ready to dive into this textbook once again.

Last time we were on calculating hosts. Today, I 'm making my first theoretical subnet. Firstly, all of subnetting starts with a single network ID. In my given scenario, I will have to convert 192.168.4/24 network ID inside the hypothetical office from the previous post, into three netowrk IDs. One for the employees, one for the management, and one for wireless users. The primary tool is the existing subnet mask. Remember, from before, write it in binary! At the end of the ones, place a line to seperate them.

Step 1: 11111111111111111111111111|00000000

Draw a second line on digit to the right. This seperates the subnet mask into three areas. The DMS (default subnet mask), the network ID extension (NE), and the hosts (H). Those are not terms which will be in the exam, but they're a useful tip given by author Mike Meyers.

Step 2: {11111111111111111111111111}|{0}|{0000000}
                                 DSM                           NE        H

Now we have a /25 subnet mask. Some would be confused, because surely a subnet mask of /25 can't fit in the three subnets of 255.0.0.0, 255.255.0.0, 255.255.255.0? Well... yes it can. If you remember correctly, subnet masks are binary, which are 1s and 0s NOT 255s and 0s. It was mentioned before, just convert the /25 into dotted decimals. This means 25 ones and 7 zeros (25+7=32).

11111111111111111111111110000000

Then insert periods:

11111111.11111111.11111111.10000000

THEN you convert to the dotted decimal:

255.255.255.128

Next we wanna calculate the subnets. When you're subnetting a network ID, you have no choice and must follow rules made by the developers of TCP/IP to make sure that your subnets will interact correctly with each other, and the larger networks. What you need to remember for subnetting in general is: start with beginning/default subnet, and extend the subnet extension until you have all the subnets you need. To determine how many subnets you created, you have to do 2where y is the number of bits you added to the subnet mask. Let's do it:

If you move the starting subnet of 255.255.255.0 over one, it's only a single digit, or 2^1

1111111111111111111111111|0|000000
                                           Start  End

The single digit is only a zero or one, which will give you two subnets. But as I said earlier, the office needs three subnets, not two. Now let's take the /24 and make it /26. Extend the network ID two digits to create four new network IDs, 2^2 = 4. To see each network ID, convert the original 192.168.4.0 into binary. Then afterwards add four different network ID extensions to the end of it:

Original network ID: 192.168.4.0 /24
In binary:
11000000.10101000.00000100.00000000

110000001010100000000100|00|00000
110000001010100000000100|01|00000
110000001010100000000100|10|00000
110000001010100000000100|11|00000

Then you convert the four network IDs back to dotted decimal:

Network ID:                                           Host Range:
192.168.4.0/26                                       (192.168.4.1 - 192.168.4.62)
192.168.4.64/26                                     (192.168.4.65 - 192.168.4.126)
192.168.4.128/26                                   (192.168.4.129 - 192.168.4.190)
192.168.4.192/26                                   (192.168.4.193 - 192.168.4.254)

And that's basically now you take a single network ID, 192.168.4.0/24, and subnet it into four new network IDs. Now as we know, the office only needed three, and we have four subnets, so we're wasting one. That will happen, so it's no surprise.

The textbook later goes on to tell me how to manually convert to binary, but I got a calculator, so I can't be bothered right now. If I ever need to know, I'll just go back to the textbook. Now in reality, there's a low probability I'll ever have to do subnetting. It is an important thing to learn, but like many things so far, it's not as important for someone to do in the real world. But why is that?, you may ask. Well to put it briefly there are only two situations where I'd need to do it! #1 If I had to subnet class licenses distributed by the IANA, to customers. #2 Very large customers that take subnets and make their own. Now even though I won't be using it real world, I still need to know it! The most important reason is obvious, for the Network+ exam!!! Then also if I ever have to do my own, or if I decide to pursue a higher level IT certification (hell yeah I will!) which usually assumes you know subnetting.
On that bombshell, I'm done with this entry. I will finish the chapter in class tomorrow. It's short and simple, not much to do. Thanks for reading, and until next time.



Tuesday, November 24, 2015

Week 12: Day 033 - TCP/IP Basics #4


Hello to anyone reading, this is my next entry on TCP/IP basics. If I can get this entry in before next week, then I will! I'm going to start picking up the pace on this again. Anyways, let's get right into it.

First, let's start out with learning about Class IDs. So the Internet is the most complex TCP/IP interwork there is, by far. When you have so many computers that an accurate estimate can't even be found then things get really difficult! This is why the biggest challenged faced in terms of the internet, is that two devices can not have the same IP. Because of this, an organization called the "Internet Assigned Numbers Authority" (IANA) was founded. Their job is to track IPs, and distribute public IPs to those who need it. They now also have control over a few RIRs (Regional Internet Registries) that hadn out IP addresses to the large corporate ISPs, like the ones we all know, "Comcast" and "Verizon". And it's these ISPs that hand out the IPs to customers. In essence they're like a middle man in this. Now the IANA doesn't just pass these out willy-nilly, there are different chunks of IP addresses called "class licenses". Here in Arlington, we have a class license of Class B, which is big for a county our size (hint: it's one of the richest counties in the United States) but good to have I suppose.

Here's a chart on Class Licenses:










Now a Class A license will have a network ID between 1 and 126, and hosts on the network can only have the first octet in common. This gives a huge amount of potential hosts, over 16 million!!! The chart is self explanatory with the subnet masks, so I will skip over that. Then the Class B license uses the first two octets to define the network ID. With this you cna have 65,534 possible hosts. Finally the Class C license has the first three numbers in common, with only 254 possible addresses. The other ones are not as important. Anyways, IP class licenses worked well for a while, but then the amount of IPs started diminishing. As you can tell by us having Class C, the IANA were a bit generous when handing out IP class licenses. In today's world, there is a new method of generating blocks of IPs, this is called "Classless Inter-Domain Routing" (CIDR). Before I continue there's a kind of shorthand that people use for subnet masks.
A /(number of ones in the subnet mask) is the method, for example:

11111111111111111111111100000000 = /24 (24 ones)
1111111111111111000000000000000000 = (16 ones)
111111110000000000000000000000000000 = /8 (8 ones)


What the heck is CIDR? Let's find out. This is a concept which is based on subnetting. Quick throwback, subnetting is when a single class of IP addresses are chopped up into smalled groups. Basically these two things are the same thing. However, the perpetrators are different. Subnetting is done by an organization, while CIDR is done by an ISP like Comcast. They've been around a while, and are critical to all TCP/IP.

Let's look into subnetting a little more to understand CIDR. So what is the purpose of subnetting? Well it's an efficient way of using IP addresses in comparison to class licenses. With it, you may control bandwidth, network seperation, etc. Now how do you subnet? Let's visit our old friend the subnet mask. You take existing subnets and extend the subnet mask. How so? You add more 1s. Let's bring in a hypothetical. Say that you were in an office building, and there were 50 computers for your workers, but 10 for administration. You don't want the employees to get into the administration machines, what do you do? Let's add something into the mix, you have wireless Internet, and want to separate the wireless clients to their very own subnets. First, you look at the subnet mask, move it towards the right until you have the number of subnets necessary. Next, forget the dots! Why is this? Well many techs fall victim to the dots, which is basically not converting to binary. They do this cause they're more used to class licenses. This in mind, the trick is to stop thinking about the network IDs and subnet masks in their decimal format and start thinking of them as binary numbers. Now let's start subnetting the network of our hypothetical.

When you're on the /24 subnet, add a zero so it becomes /25 subnet:
11111111111111111111111110000000

Now, on a /24 network, how many hosts can there be? In dotted decimal, this is how you would put it.

192.168.4.1 to 192.168.4.254 = 254 hosts

However, you gotta do it with binary instead. In a /24 network, there are eight zeros that could be the host ID:

00000001 to 11111110 = 254

My textbook claims this is a simple piece of math: 2x - 2, where x represents the number of zeroes in the subnet mask.

2^8 - 2 = 254

Remember this formula, and it will be easier to find the # of hosts in a subnet. If you have a /16 subnet mask, what is the maximum host count?

1. A subnet mask has 32 digits, so if you had a /16 subnet, taht means 16 zeroes would be left after the 16 ones.
2. 2^16 - 2 = 65,534

To complicate things a bit, what if you have a /26 subnet mask on your network?
1. Since a subnet mask has 32 digits as established, a /26 subnet means there are 6 zeros after 26 ones.
2. 2^6 - 2 = 62

This is precisely how you determine the number of hosts on any subnet mask. Next time, I will make a subnet! This week is cut super short because of Thanksgiving break, so I'll be off the rest of the week after today. I'm still going to try to make a new entry, and finish off this chapter, once and for all! Thanks for reading, and goodbye.

Friday, November 20, 2015

Week 11: Day 032 - TCP/IP Basics #3


Lately my entries have not been as long, there have been many distractions, and hopefully I will be able to summarize them by the end of the week. But for now, I will continue to focus on this. So today, I'll start off by talking about "IP Addresses in Action" as that's what the textbook has next in store.

First, IP Addresses support both LAN and WAN. When a computer needs to send data to both, some problems can arise. To make it work it needs to do three things:

- Create a way of using IP addresses so each LAN has some form of identification.
- Interconnect the LANs with routers, and give a way for the said routers to use the network identification to send packets to the right network.
- Give every computer on the network a way to recognize a packet as one for LAN or a computer on the WAN so it knows where to send it.

Each computer on a single LAN shares similar IP addresses, some parts match, while others don't. Only the last number is different. To give an example, if I had an IP of 202.140.10.x the x part would be the host ID in the IP. The network ID would be 202.140.10.0, because no computer can have x = 0 in that scenario. A router therefore needs an IP address for the LANs that it serves, so it can route the packets correctly. That router is known as the "default gateway" which I already knew! Most network admins will give the LAN-sided NIC on the default gateway, the lowest host address in all the network, which would usually be 1. Routers use network IDs to assess the network traffic and activity. In a two-NIC router, you'll see one port (ex: 202.120.10.1) connects to LAN while the other port connects to the ISP (ex: 14.23.54.223) and the built in a router is a "routing table" which give instructions to the router on what to do with packets. Network IDs are flexible and as long as two devices don't have the same IP, you can give your device whatever IP you want! Network IDs allow you to connect multiple LANs onto a WAN. Routers will then connect everything with their routing tables.

Next, there's the subnet mask. Say you had three devices on a network, but two are on one LAN, while the third one is on another LAN, how do you communicate these computers? Getting a packet to a local device is much different than getting one to a faraway device. If one of the computers wants to send a packet to your computer, it would send a broadcast to try and get your MAC address. Now, a subnet mask is a string of binary which also totals to 32 bits. Here's the conversion process:

11111111111111111111111100000000

11111111.11111111.11111111.00000000

255.255.255.0

Quite similar to the IP conversion, eh? Basically each octet has a decimal. Before the computer sends data, it compares the destination's IP and its own, using the subnet mask. If the subnet masks match, then it knows that the destination computer is on the local network. Now, say that the IP address on the first computer of this hypothetical has an IP of "192.168.5.23" convert that to binary:

11000000.10101000.00000101.00010111

Get rid of the meaningless periods:

11000000101010000000010100010111

Then say that the first computer wants to send a packet to computer two. The subnet mask on the first computer is 255.255.255.0 while the IP address on computer two is "192.168.5.45". Convert that address to binary:

11000000101010000000010100101101

The first computer will compare its IP address to the destination's (computer two) IP using the subnet mask here's a diagram to show exactly how the computers use the subnet mask as a way to identify that they're both local:

Subnet mask: 111111111111111111111111|00000000
Computer 1:   110000001010100000000101|00010111
Computer 2:   110000001010100000000101|00101101

What do both IP have in common? the 1s match in the Subnet Mask and both of them! Thanks to that chart, I'm easily able to understand what the purpose of the subnet mask is (note to self: that chart is useful!) and that's pretty much it.

Now that computer one knows that it's a local call, it can send an ARP request, a broadcast to find the destination computer's MAC address. The ARP (Address Resolution Protocol) is the way a TCP/IP network determines the MAC address based on the destination's IP address. Then the destination computer responds by sending computer one an ARP response. When computer one gets the IP, then it sends the packets.

What about if computer one wanted to send a packet to computer three? Well it would do what I said before, and compare the subnet masks. It will then find out that the IP addresses don't match. When it does that, it then makes a "long-distance call". To send a packet to another LAN, the sending computer (computer one) knows to send it to the default gateway. It still sends an ARP request, not to the destination, but to the default gateway. When computer one gets the MAC address of the default gateway, it sends packets to it.

In conclusion, something to note is that subnet masks can come in different lengths. For example: 255.255.255.0, 255.255.0.0, and 255.0.0.0 (remember these are in 32 bit binary numbers.) At the end of the day, if you want to get your computer routed to the interwork, you must have an IP address which is part of the network, and must have a subnet mask, and a default gateway. On that bombshell, thanks for reading, and goodbye!


Thursday, November 19, 2015

Week 11: Day 031 - The Grand Project #3



Hello again, today I will summarize what I've done for a lot of the week. I'm revisiting the Grand Project, since now we have stuff to do on it. We've done quite a bit since last time. Last time we were working on getting that hard drive to work, this time it's something more essential. We're trying to get the touchscreen which will be implemented to work.

Firstly, what we're attempting to do now, is to get the touchscreen attached with the Raspberry Pi, to try and get it to start displaying OSMC on the touchscreen. However, we've encountered many problems with this. So we assembled the entire thing, and it has not worked thus far. It's very mysterious as to what the problem actually is, but it has been frustrating trying to find a solution. What we've had to do for the last few classes and even part of last week, is look at manuals and guides on how exactly to do this. We must have taken it apart and put it back together at least three times now, it's insane!

BUT, there's some good news to all of this. It's been a day or two, and Marco actually found out that he reversed the video cable, which is paper thin (just a note), and put it in the right way. I went to the bathroom, and came back... they got it to work. FOR A FEW SECONDS! Marco then turned it off, tried to put the case back on, and it hasn't work since. I'm sat here thinking I won't live to see the day when this touchscreen actually works. Also something to note, I've been progressively working on an entry for TCP/IP but I've been distracted a lot, so I'm not ready to post that yet.

It has been another day in the week, and although we're working on the Raspberry Pi, one of the students in my class had a problem with their computer, so Marco, Shams, and I looked at it. When you booted it up the computer it get seven loud beeps. At the time Marco thought it was a problem with RAM, and he was wrong. We opened up the computer, found out his processor is pretty banged up, so that turned out to be the issue, or if not the entire motherboard itself. Anyways, when I looked it up, I was able to find out that it was a problem with the motherboard or processor before we even confirmed it. Unfortunately, there was no quick fix, so the owner will need to buy a new processor for his laptop.


To conclude, it's been a couple days, and that guy Kevin Cole came here again today (I'm gonna start calling him KC), and we had a group talk Mr. Nolen was there too, and we decided to install Raspbian OS onto another micro-sd card as sort of a diagnostic tool. Why would we do that?, you may ask. Well it's a more developer-centric OS, so we have more accessibility and more information will be given to us, and more importantly, that OS will work with the touchscreen guaranteed. I think I've made a lot of progress this class than any other this week. So KC showed me how to data dump this class, and yes I know we've done it before, but this time I actually understood the stuff he was saying, so happy days. Something else to note is that we actually haven't done anything with the card yet. Right now KC and Mr. Nolen are using our workstation for something they're doing with a homemade 3D Printer. If we get this to work, I'll consider making another entry by that point, but for now, I'm done with this!

Sunday, November 15, 2015

Week 10: Day 030 - The Majority of this Week


What have I been up to all week? Well one things for sure, I've been busy enough not to be able to post as many blog entries as I usually do. Something that's really worth noting, is that we had a short week to begin with, knowing that Wednesday was a day off for Veteran's Day. Regardless, I did quite a bit.

First, towards the beginning of the week I was given a task by Mr. Nolen outta the blue, to try an mount an image onto some type of storage, so he could do something for his students. But what, you may ask? He took me around showing me exactly what he was trying to do, which was virtually replicating a project he did a long while back. It was a wooden handheld gaming system, if that makes any sense. Basically, the image that he mounted in the past was an emulator which emulated games from the past, which I probably wasn't even alive to see released. It had stuff like N64, Gameboy, Gamecube, the works essentially. Anyways, he was using a Raspberry Pi to be the center of the thing. The SD card which was meant to store it, only had 2 GB. So we went around looking to see if any teacher had an SD card which had enough space to store the image, which was around 4 GB. Nobody did, so I started my post from earlier in the week, and did that for the remainder of the class. 

Next class, I thought I would just go to Mr. Randolph and straight up ask him for an SD Card which would match the space necessary. He gave me a 64 GB SD Card! I went out of his office going like, damn, so much space for something as little as this! Anyways, I tried to mount the image on Windows, but when I needed the password to install the necessary software for the process, Mr. Elkner told me, "Do it in Linux.", so I went on Ubuntu, and had Marco spearhead the process on there. First we needed a way of getting the SD Card into the computer, so we were given a USB by Mr. Elkner which was essentially an adapter from USB to SD. We then put it into the computer, and were met with error messages when trying to mount the actual device to the computer. After trying to troubleshoot the problem, Marco decided to install drivers which were compatible with "exfat" the format of the USB. It then successfully mounted it, but we still had trouble getting the image to mount. Then after searching a lot, I accidentally came over the solution, which was to do a data dump. Data Dumping, really is just giving raw data from the computer to the device at hand. It's important to remember, all that data is just a bunch of bits, all in binary (which is important to learn!) However, we had no clue how to do it, so Mr. Elkner asked one of his friends to come in early to the Career Center and show us how we go about doing it.

The following day, someone who Mr. Elkner referred to as Kevin Cole came in, and he was that guy. He showed us how to data dump, but he met some trouble in the process as well, leading me to start writing a new entry for my Network + Textbook, which should be finished by tomorrow, as a way to wait until they figured out the problem. It wasn't really that I had no interest, it was that I had no knowledge to be able to help in the situation; so that's why I started writing my entry, to be efficient with my work time. They were able to solve the problem in the end, and did a data dump, but it turns out the Mr. Nolen already did all that on his own (he probably used Windows haha!)

To conclude, I really spent a lot of time on that issue, more than I probably should have, but in the end I learned about data dumps, and when they should be used. My Network + Textbook kind of ignores Linux in a lot of cases, so it's really up to me to be learning these things, so I think it would be smart to start posting entries on my learnings of Linux commands, and how I fare with the terminal. That really sums up my week, lots of stuff, but not so many blog entries. Thanks for reading nevertheless! 

Thursday, November 12, 2015

Week 10: Day 029 - TCP/IP Basics #2


Last time I went over the protocols of TCP/IP and how it fits in with the theory. Today, I'm gonna go more in-depth with the Internet layer and IP addressing. This will lead me head on in the the important parts of this chapter, goodie!

Firstly, at LAN level, all computer use Ethernet, which makes an obstacle for WAN (wide-area network) communication. As we know, a computer sending a frame to another, must know the MAC address of the computer it is sending to. But how does it get it? Well it's actually quite simple, in a network, the sending computer broadcasts its MAC address by sending a frame to the universal MAC address which is, FF-FF-FF-FF-FF-FF as if there couldn't be anymore Fs. This however, takes up some bandwidth, so if the entire Internet started broadcasting, well the Internet would DIE! So to overcome this, TCP/IP networks use IP addressing, as we all know. Every device on the network has an IP address that is provided by the TCP/IP network. This is, like the MAC Address, used as an identifier.  Then the IP addresses starting grouping up into sets to create a logical network that can tell the difference between one LAN and another. Because the TCP/IP network equipment is so great, it can communicate between LANs within a WAN without the need to broadcast MAC Addresses.

Now it's time to gain a greater understanding of IP addressing. The most common type of IP address is IPv4 which has a 32-bit value.

Guys, here it is:
1100000010101000000001000000000010

U WOT M8? What even is that?! Well apparently this is the long version of an IP Address, it's actually shortened into what we see. All IPs are, is 32 binary digit, which are broken down into groups of eight., and seperated by dots.

It looks more like this:

11000000.10101000.00000100.00000010

Still not the IP I know. Each of the 8-bit values are converted into a decimal number between 0 and 2055. So after that conversion, it looks like this:

192.168.4.2

That's more like the IP I know! That's in IPv4 dotted decimal notation. Unfortunately for me, people that work on TCP/IP networks must know how to convert binary to dotted decimals. However, it's easily done through the operating system's calculator (Linux has a bunch.) To convert decimal to binary, go to decimal view, type in the value, switch to binary value, and you get the result. You can do this vice versa to get the opposite. Similar to the MAC Address, on every network, as I've said, the IP needs to be unique as well. You will never find two computers on the network with the same IP address. Every operating system has a way of seeing the system's IP and MAC Address. For example, on Windows, you would obviously put in ipconfig, and get them for the system. On Linux/Mac OSX it's practically the same, ifconfig. That ends this entry, thanks for reading, and goodbye.

Sunday, November 8, 2015

Week 9: Day 028 - The Grand Project #2



Hello there! I have decided to call this "The Grand Project" for no specific reason at all. It's just going to be a grand thing! Anyways, we've made some great progress on this in the past week.

First, we moved on from last time by adding the latest addition to the Pi, which we received from the IT guy here. We plugged it in to the Pi directly, and... it didn't work. The whole thing just froze and skipped frames. Why in the world would this happen?! We tried to figure it out by unplugging and plugging stuff back in, but I will give credit to where it's due. The intelligent Marco (Take a look at his blog: www.linuxubuntu2.blogspot.com) found out that the disc drive was taking up too much power! Since there wasn't enough power as a whole being given, we needed to find a way to provide enough power to the drive. At first it we were wondering how to do it, but then it occurred to us that we could simply get a powered USB hub. Problem was, where were we gonna get it?

Next, we went to the teacher leading the project, Mr. Nolen, and asked him where we could obtain one. We couldn't find the IT guy, so we couldn't get it from him, so Mr. Nolen ended up taking us to a bunch of boxes in the autotech area of the Career Center. Basically the boxes were full of stuff from his predecessor, and man did I see some great stuff in there. Whoever had his job before him, was a hoarder! This guy had tons of ram, motherboards, and whatnot, not to mention a couple of headsets too. However, we needed to find the USB hub, not all that stuff. Once again, Marco came through by finding a USB hub which worked. The next step was to find it a proper power cable that worked. We found one that seemed it could work, so we took it back, and just as we thought, it didn't work. It was too small and fell out to easily, obviously not the right one. I let Marco continue doing work for his other class, and I went back to the boxes to find the power cable.

Once again, I have to stress that whoever was there before Mr. Nolen, was a hoarder, he kept so many power cables in these boxes too! It took me quite a bit of time, but eventually, I found the right cable that worked!!! We plugged it in, and just as I thought, it worked. We were ecstatic at the fact that it finally worked. In fact, Mr. Nolen hailed us as geniuses, which was a bit humorous to me, since we bloody aren't!

Finally, we needed to get the wi-fi to work on this thing. Well, turns out this would cause a lot of problems. The great Mr. Elkner gave us a wi-fi adapter, it was a really small one, the size of a bluetooth. We just put it in the hub, and to our surprise... it didn't work. What could have been the problem? We suspected that perhaps it was another power issue, which it wasn't really. But then once I looked up the details, the USB hub was pretty bad. It used USB 1.1 which had slow data transfers, and it only had 4 USB ports. Then I thought, you know what?, I'm gonna get a new one! So then Shams, who's also part of the project, went with me to find the IT guy, who's actually called Mr. Randolph. We knocked on his door, and he wasn't there. Then outta nowhere I heard "Mr. Randolph" from downstairs. Someone was calling for him, and then I poked my head down the railing, and he was standing right there! I exclaimed, "Hey, we need something for the project with Mr. Nolen!" He came up, and low and behold, he had exactly what we needed. He gave us a Belkin USB hub, it had 7 ports, and it was USB 2.0 which was a good upgrade. This time, it came with a power cord haha. We got back, and Marco once again brilliantly solved the wi-fi problem, by figuring out, that it was disabled. I set up the new hub with him, and then Marco ssh'd into it and enabled wi-fi. We connected to the concealed network that Mr. Elkner is quietly keeping haha (not sketchy at all), and it worked just fine.

In conclusion, we went to Mr. Nolen and he was ecstatic, and as always said "gangster" as a happy response to our progress. Now, it seems that the next step is to work on the car, so I may not be doing as much on this "grand" project. But so far, I'm pretty happy with what we've achieved. On that bombshell, thanks for reading, and goodbye!


Thursday, November 5, 2015

Week 9: Day 027 - TCP/IP Basics #1


Finally, the time has come! Today I will be starting the chapter on the basics of the widely used TCP/IP. Let's go!

Back in the day there were an innumerable amount of standards set. Many people wanted their standards to be the ultimate one, and it made it really hard for those who wanted to run a network, or even more, a cross-platform one. The OSI model was being interpreted in many standards and many ways, and people were getting annoyed at this. In the end, TCP/IP won, as you can imagine.

Firstly, when it comes to TCP/IP protocol suite, I will be focusing on th top three layers which are "Internet, Transport, and Application". In an IP packet there are some parts of it that flawlessly fit into one of the respective layers of TCP/IP. All the parts consists of headers, and data to go with it. The payload of the packet can be a TCP segment with data from layers above and a sequence number. The higher up the model, more headers are removed until all that's left is the data.

The Internet Protocol (IP) is in the Internet layer, as you would expect. It takes the data from the transport layer, adds some addresses, and creates the final IP packet. Now let's see how it does it. The textbook gives good examples.

Most people have seen IP addresses like this:
192.168.1.115

That type of address has four values which range from 0 to 255, between three dots or rather periods. Officially this is known as IPv4 addresses, but I already knew that! However, soon we'll run out of those IPs so we'll need something new, and that is called IPv6.

These addresses are extremely long and are like this:
2001:0:4137:9e76:43e:2599:3f57:fe9a

But these aren't the only protocols that do stuff in this layer. Some applications test basic issues at that layer, such as identifying IP addresses. Those applications use ICMP (Internet Control Message Protocol). Those programs are rarely started up by TCP/IP users, but most of the ICMP features automatically start on demand of the applications, and you won't ever know. One widely used program that runs ICMP is the "venerable ping utility". You can run the ping command (from cmd I assume) and do da ting. The ping tester displays the RTT (round trip time or real transfer time) of the the ICMP packet, which takes seconds, or so it should. If ping can't find host, it will time out.

The important protocols of the Internet Layer to remember is:
- IPv4
- IPv6
- ICMP

The full IP packet has 14 fields, according to my textbook. Here is some basic information about the important ones:

- Version: The version (Ver) defines the IP address type: 4 for IPv4, 6 for IPv6
- Header Length: The total size of the IP portion of the packet in words (32-bits) is displayed in the header length field.
- Differentiated Services Code Point (DSCP): The DSCP field contains data used by bandwidth-sensitive applications like Voice over IP
- Time to Live: Routers on the Internet are not perfect and sometimes create loops. The Time to Live (TTL) field prevents an IP packet from indefinitely spinning through the Internet by using a counter that decrements by one every time a packet goes through a router. This number cannot start higher than 255; many applications start at 128.
- Protocol: In the vast majority of cases, the protocol field is either TCP or UDP.

Next, there's the transport layer protocols. This is responsible for identifying whether an application is connection-oriented or not. As I said in the past, in TCP/IP the TCP (Transmission Control Protocol) protocol is the connection oriented on, while UDP (User Datagram Protocol) is connectionless. Also quick not, you don't get to choose the protocol, the developers of the application do! For example, something like HTTP is built on TCP, and that will never change. Now, over 95% of applications use TCP, which is why it's called TCP/IP and not UDP/IP. What TCP does is, move an applications data from one system to another, completely and effectively. Because of this, it comes with rules on communication, that need both systems (receiving and sending) to acknowledge when they send/receive the data. This processs is called ACK/NACK or ACK. What TCP does as well, is split data into segments, then giving them a sequencing number, and verifies that the said segments were received properly. If one is missing, they send the missing piece. A simplified TCP header will contain 4 things "Source port", "Destination Port", "Sequence Number", and "ACK". So what's a port? I already bloody know, but I'll go over it. The port numbers range from 1 to 65535, and are used by systems to find out what application needs what to properly receive data. Web servers use port 80, as we all know, specifically HTTP, and there's also port 110 used for e-mail. So let's look at the TCP header. The header contains this:

- Sequence Number: Used to assemble/disassemble data.
- ACK number: Tracks readiness of two systems to send/receive data.
- Flags: Individual bits, give detailed info about connection status.
- Checksum: Checks TCP header for errors.

Then we got UDP, which isn't as important in the TCP/IP protocol suite. The UDP datagram doesn't have the extra data checks to make sure the data was not corrupted. Basically, UDP is great to use if you don't have data that needs to be sent in perfect state. For example, in a VoIP call it would be fine. The UDP protocol is very fast compared to TCP.

Finally, there's the Application Layer protocols. It's job is literally just as you would think, to move data between clients and servers, which are applications, on the network. The textbook gives an example of the most popular application protocol, HTTP. The header is a "response with a segment from the web server, telling the remote system that the last set of data transfers is complete." The header begins with the value, which is "HTTP/1.1" and the number "200" followed by "OK\r\n", it means "OK, go to the next line". That was probably confusing without actually looking at the figure, so I'll refer myself to look at pg. 184 of the textbook to see the figure. Anyways, that was all the covered on how the TCP/IP protocols fit into the model. Next time, I'll be going back to the Internet Layer for some more IP addressing exploration. Thanks for reading, and goodbye!

Wednesday, November 4, 2015

Week 9: Day 026 - The Grand Project #1: Kodi and Rasberry Pi


If you're wondering what happened to me for most of last week, this entry is going to answer all those questions. Basically, I've become part of a project at the Career Center, where a car will be made from scratch, and basically become a cool entertainment-mobile so to speak. It'll have a couple Xboxs and a Raspberry Pi which will be another entertainment device. I'm working with my peers Marco and Shams who were the main members of the project with the Raspberry Pi. When they had trouble getting it hooked up to the Internet, I helped them out, and sort of assembled into their project.   

Firstly, the Raspberry Pi is using OSMC, along with Kodi. Since I've had previous experience with Kodi, this has been less difficult than it could have been. Basically, what we've done is set up the Raspberry Pi so it works with our new workstation. Afterwards, we got into Kodi, got a nice skin, great stuff.

Next, I got the largest repository you could possibly get, onto Kodi. With that, I was able to get some great addons, so happy days! Later, the guy running the project, Mr. Nolen, showed me what the car looked like. It's honestly a BMW rustbucket haha. Apparently they're gonna rip out the dashboard, put in a new one, and we will implement the entertainment system.

My friend Marco has found out how to ssh into the system, showed me how, great stuff! It will be useful for our lazy selves in the future, but I think we should probably get a remote, cause that will give it an extra notch of cool. We tried to get some music playing, but it was being annoying and decided not to work, so Marco just transferred a file from his computer which contained Halloween songs. I guess he's in the spirit of Halloween.

Finally, we went to the IT guy of this school, and he handed us a USB DVD Drive. We were kind of shocked that they would just hand stuff like that out, I mean I know this is for an important project, but it's not everyday you see something like that. That's pretty much what we did for a lot of last week and on Monday, except put into brief paragraphs. On that bombshell, thanks for reading, and goodbye.