Wednesday, December 16, 2015

Week 15: Day 042 - TCP/IP Applications #2


Hello again people, today I'm here with the second blog entry for this chapter. There are a lot of pages left, but let's hope we can do this in three blog posts! Let's start.

The sheer power of TCP/IP can be understood by going into the port numbers. To pass the Network+ exam, it's essential to know how TCP/IP uses port numbers. Basically, port numbers are what make NAT work. Network Administrators should be able to manipulate port numbers to their network's needs. A port number is a 16-bit value between 0 and 65535, to give an example of a popular one, port 80 is used for HTML and other important web stuff. When a web client sends an HTTP ACK to request a web page, the IP packet will look like the figure on pg. 281 in which the destination port is 80. The web client's source port is generated by the web client randomly. The value varies between 1024-5000 which are port numbers that were classically ephemeral port numbers, while 49152-65535 are the dynamic/private ports. Then when the serving system responds to the web client, it uses the ephemeral port number as the destination port to receive info from the web client on the client computer.

Now, the port numbers from 1024-49151 are registered ports. Unlike well-known ports, anyone can use those port numbers for servers or ephemeral numbers on clients. Most operating systems won't use those ports, just the classic ephemeral ports, which are dynamic/private ports. Here's the list:

Well known port numbers: 0-1023
Registered ports: 1024-49151
Dynamic or private ports: 49152-65535

Every computer in a session has to keep the status of communication. In TCP/IP the session info is stored in the RAM, and it's called a "socket" or "endpoint". The session as we know is the connection itself. Here are the summary of terms:

- Terms for the connection data stored on a single computer: socket or endpoint
- terms for the connection data stored on two computer about the same connection: socket pairs or endpoints
- Terms for the whole interconnection - connection or session

When two computers communicate, they store info about the session so they know where to send and receive the data. All operating systems have "netstat" which is a utility to find the endpoint. It works on command line as "netstat -n" to see something like the figure on pg. 283, and you'll see many connections. One thing to note is that just cause a single application is open, that doesn't mean that it's automatically a single connection. The example on pg. 285 will show you what it looks like when you type that command. A single web page will need but one connection, although if it's complex it will need more. The Network+ test will have questions on netstat. The powerful netstat tool will be used a lot since it's important. Mike Meyers recommends getting TCPView, it's open source. It only works on Windows.

Then there's the connection status which changes all the time, and it's useful to have netstat and TCPView to see what's happening on the networked computers. A socket responds to any IP packets that's destined for it's respective port number, and it's called an "open port" or "listening port". Every serving applicatiosn will have an open port. If you happened to run a web server on a computer like my friend Marco, then you will need port 80 open. Start netstat and type "netstat -an" to see all the listening ports. It will give information like the figure on pg. 287. From that point most of the information is based on figures, so just look at that to learn more about listening ports and netstat. The only difficulty really, is identifying what certain connections do. You'll notice my entries are getting shorter. I'm covering more in a smaller amount of time. With that said thanks for reading and goodbye!


Completion Status: 43%
Pages Left:
- Book: 388 pages
- Chapter: 22 pages

Tuesday, December 15, 2015

Week 15: Day 041 - TCP/IP Applications #1


Hello ladies and gentlemen, today I am starting a new chapter! This one is called TCP/IP Applications, and I will start rushing. So hold on tight, cause there will be no more specificities, now I'm all-in. Let's go!

Now, TCP/IP is extremely broad since there are hundreds of terms that go into it (Ex: UDP, ICMP, HTTP, DHCP, POP), but it's the simplest way of establishing the protocol as a whole. Imagine that you were having a friendly conversation with someone, in networking that's known as connection-oriented communication. Any communication between a computer and another is called a "session". For example, when you open a webpage, a session has started. Transmission Control Protocol (TCP) enables this type of connection-oriented communication, and it also happens to be the most popular session type on the average TCP/IP network. As is obvious there is the server which hosts the webpage, while the client has the web browser. When you enter a web page ,the client sends a SYN (synchronize) packet to the web server. The server will return it, if it does indeed receive it, while also sending an ACK (acknowledgement) packet. Then the Client will send an ACK to the server. This is known as a TCP "three-way handshake". When the server finished sending the web page, it will send a FIN, ACK (finished, acknowledgment) packet. Client responds with an ACK packet with its own FIN, ACK packet. Then both the client and server will consider the session closed.

 Most TCP/IP applications will use TCP because despite the fact that some packets will not reach the destination, the computer receiving will just ask for a repeat to receive it. The User Datagram Protocol (UDP) is used a lot, but not as much as TCP by a mile. It's great for sessions that don't require connection-oriented things. Then there's Dynamic Host Configuration Protocol (DHCP) and heck, we already know what that is. This is an example of an application which uses UDP. Every DHCP session will just send information without confirmation. It uses two port numbers, 67 and 68 for sending data to DHCP clients. More examples, there's NTP/STNP which are also popular applications which happen to use UDP. they stand for Network Time Protocol (NTP) and the lightweight version Simple Network Time Protocol (SNTP). Those protocols will sync the clocks of devices on a network to the right time. It uses port 123. Then there's Trivial File Transfer Protocol (TFTP) which enables file transfers from one machine to another. This is a critical data transfer, which shows that UDP can be used for such things as well. However, TFTP using UDP doesn't have data protection, so across the Internet you wouldn't use it.

We know that TCP and UDP have extreme differences, one being connection-oriented, the other not. However, both will modify and manage packets with a destination IP and port numbers, as well as source IP and port numbers. Although a session could have one packet or several take place during the transfer, sometimes applications are so simple they're always connectionless and don't need more than one packet. Ping is one way that you can see ICMP in action. It sends a single ICMP packet called an "echo request" to the IP address you want to send it to. All computers with TCP/IP will respond to those requests with an "echo reply".

Back in Chapter 7 there was talk of IP multi-cast addresses. The challenge of doing such a thing is to determine who wants the multi-cast and who doesn't. The Internet Group Management Protocol (IGMP) enables routers to communicate with hosts to determine a group membership, as my textbook puts it. Also, multi-cast is in the Class D range, meaning it uses a small subnet of the Class D range. Those who want multi-cast must tell their router or switch they want it. To do that, they have to join the IGMP group. This ends my entry for today, more to come tomorrow! Thanks for reading, and goodbye. 


Completion Status: 41%
Pages Left:
- Book: 399 pages
- Chapter: 33 pages

Friday, December 11, 2015

Week 14: Day 040 - Routing #5


Hi people! Today is what I anticipate to be the last entry of this chapter, fingers crossed it is. When you get to the end of reading the post you'll see, but for me, I'm just starting out this entry. I take notes as I go.

Firstly, we're going to cover working with routers. This should really take a jiffy, because it's probably not stuff that I haven't covered. So, how do you go about connecting a router to a network? Well, there's several methods to doing that. One ancient one is using the serial connection. However, that's unique to Cisco routers. But Cisco's massive userbase make it a must know for the Network+ test. The serial cable is known as a "rollover" or "Yost cable". Switches and routers both have a configuration interface. Although, let's be honest, what is there really to configure on a switch? Both routers and switches are known as "managed devices". When I refer to router later in the entry, it's good to note that it will work with a switch as well. So when you've made your connection with the cable and the router, you'll need a terminal program to communicate with the router. The popular ones are PuTTY and HyperTerminal. To use the programs you may need to know a bit about serial ports, these settings will get you connected though:

- 9600 baud
- 8 data bits
- 1 stop bit
- No parity

After configuring it, then it's time to connect. Cisco products will run Cisco IOS, which is their operating system. The Network+ exam won't test me on my knowledge of the terms, so I won't focus on that. Then when I've connected to the router, set up the terminal emulator, then I'll see the initiating router prompt. You can't do much without knowing the commands. Type "enable", then the prompt will change to Router# which I don't know what that means. Then it will get more complex, blah blah, who cares. It's not my problem right now, since the Network+ exam won't cover that.

Routers usually come with a built-in Web interface, which will let me do what I need, and it's easier than that Cisco nonsense command line IOS. For the interface to work properly, the router should have a built-in IP, or you must assign it one. The point is, the Router has to have one. If it has a default IP, it will tell you in the manual. One thing to never do, is plug in a new router into an existing network. It might start doing all sorts of crazy stuff. If it had DHCP, then you'd have a rouge DHCP server ruining your network. Now that I think about it, it would make for such a sinister plan haha. Connect a router to your arch nemisis' network, boom "I got internet problems". Jokes aside, most router techs will use a laptop and crossover cable to connect to the new router. To get to the web interface you would try and set your network ID to the same of the router, then connect to the router. Enter the default IP into the browser, then do "admin" for user and pass, since that's the default. When you've accessed the web interface, you can do whatever. Then there's also Network Management Software (NMS) which knows how to talk to everything in your network pretty much (i.e: routers, switches, computers) and it enables you to have an overall look at your network. Usually it's a web site, which is why you type your default IP in the browser to take a look at the NMS. Sometimes the NMS tool isn't that good, and guess what. I have personal experience, Belkin released a firmware update for my router, and the new firmware is trash! Continuing, there are other ways that your router can connect, like USB and blah, who cares?

Next, we got the basic router configuration. A router MUST have two connections at the very least. When you set up a router, every port has to be configured for the router to work with its network IDs. Therouting table must send packets to where it needs to go. Here are the steps:

Step 1: You set up the router's WAN connection, DHCP is strongly suggested. Note: ISPs will still sell you static IPs apparently. In such a case you'd need to set your router to Static IP (through the NMS.)

Step 2: Set up the LAN, you have complete control over this, unlike the WAN side. You choose a network ID, then assign the correct IP information to the LAN-side NIC. You can also see the LAN NIC on your NMS (very useful, isn't it?)

Step 3: Establish routes on your network.

Step 4 (Optional): Configure a Dynamic Protocol. I'm not even going into this, cause I probably will never be doing this (and it's irrelevant to the exam.)

When you've finish configuring routes, document what you did. I should do that with a lot of things, but I'm too lazy. Let me tell you my memory is not the best, so yes document things! Also backing up your configuration is probably a good idea just in case you forget or something goes wrong.

Finally, router problems! Fun stuff, right? Well the Network+ exam is great at giving you problems so I'll need to be solving them. The questions are straightforward as long as I know this:

- Consider other issues first because routers don't fail very often.
- Keep in mind what your router is supposed to do.
- Know how to use a few basic tools that can help you check the router.

Router problems begin with someone not being able to connect ot someone else. Even a small network has several NICs, computers, switches, and routers. These are a lot of devices, so it could be a lot problems. The last thing you should look at as the culprit is the router, since it's robust. With that said, it's a good idea to mention that there could be some serious, but rare, problems with the router. Just look at your routing table first, to determine why packets aren't being transferred properly. I'll end it here, because the last pages of this chapter 270 and forward give specific examples, LOOK AT IT! It gives good examples. With that said, thanks for reading, and have a good weekend.

Completion Status: 40%
Pages Left:
- Book: 409 pages
- Chapter: 0 pages

Thursday, December 10, 2015

Week 14: Day 039 - Routing #4


Well hello again! Today, we're gonna do some more routing, I think this will be the second to last one. I anticipate doing about 8 pages today. I might also start doing entries from home. Regardless, let's get right in!

So last time we talked a bit about RIP and BGP. Well basically, the limitation of RIP motivated people to create a fast protocol, with low bandwidth requirement. This brought forth the "Link State" dynamic routing protocols. There are only two protocols for Link State, they are: OSPF and IS-IS (Not Islamic State.)

Firstly, Open Shortest Path First (OSPF) is the most common one of the two. Even most ISPs use OSPF, chances are, you do too! It converges at a much faster rate than RIP, and works within a single AS. However, if you plan on using it, it's a pretty complicated protocol. There will be no OSPF on low-end routers cause it takes a lot of computational power. The main reason this is important to cover, is cause it will be on the Network+ exam! The difference with OSPF and RIP, is that OSPF is designed to work with the Internet. Let's use the example from last time of RIP, and this time use OSPF. By the way, if you don't have this textbook, you'll probably be out of luck (I'm using "All-in-One CompTIA Network+ Fifth Edition.) If you do, I refer you to Pg. 255, and go back a couple pages for the example on RIP (I forgot to put that it was based on a textbook figure last entry.)

This time we're giving Router B an upstream connection to the ISP. Starting an OSPF capable router for the first time will cause it to send out LSAs (Link State Advertisements), a.k.a "hello packets", which are used to look for other OSPF capable routers. The new router will send many LSAs upon starting it, and this is known as "flooding", for obvious reasons. Another difference with OSPF and RIP are the hop costs. In RIP, the cost of a hop was always 1, unless changed manually. For OSPF however, it's dependent on the speed of the link. The formula is 100,000,000/bandwidth in bps. The 10BaseT link's OSPF was 10 based on "100,000,000/10,000,000 = 10". This shows, the faster the bandwidth, the lower the costs. You may override it manually as you could with RIP, but I don't know why you would. When an OSPF router sends its hellos, it will exchange info and update their link state databases. The hello message is project throughout the network to any other routers. Of course you wouldn't want the flood to leak out of the network, so you'd assign an Area ID to the router. Usually it's assigned one by default, and it will accept the area ID like the well behaved router it is! All routers are in the example, given let's say, 0.0.0.0 which is known as "Area 0". I wonder what Area 51 would be, haha. So Area 0 is actually important in the OSPF world, as you could make more areas if the network is to get more complex, but Area 0 would remain the default backbone, and the most important part. The reason why areas are even important are to minimize traffic between routers. Every area has one router which is the "Designated Router" (DR), I'd say it's like the President of the United Network. Then there's a backup designated router (BDR), which is like the Vice President. When the routers communicate, there's an election for the DR and BDR! Could you imagine, these routers have minds of their own! It's like if the Terminator was electing a leader (it would probably be him.) In this case, the DR is Router B, and Router A is the BDR. The election will take place during the hello packets. Most of the tie you'd just let the router decide (unless you're a dictator!), but you can manually change it, but you would be violating the humanity of the routers, I say! It's very rare that anyone sets the DR, since the routers are good at picking.

After the elections, the routes are distributed across the area. Routers A and B will send separate LSAs telling each other that they are connect to NIX and NIY. These messages don't contain the entire routing table from the respective routers however. Basically, as you can tell this process is going a lot quicker than with RIP. These routers will send each other LSAs and hello messages in intervals of 30 minutes. They also keep alternate routes, unlike RIP, which would simply discard them. Now, what if there were to be a sudden disconnection between Routers A and B? Well they'd detect the break instantly, and would try and reconnect. If that failed, then the routers would send out an LSA announcing the broken connection. It's no surprise that OSPF became so popular. In addition to all these great features, it also supports authentication and the prevention of loops. Is there any reason to why people would want an alternative? Well for a while it didn't have support for IPv6, but it does now. So there really is no reason not to use it!

Then there are the other protocols which aren't as widely used. First, IS-IS which is really the only other Link State option. It's basically a lot like OSPF, except it had an advantage to the IPv6 addressing. However, that's not much of an issue anymore. To put it bluntly, this isn't even a close second to OSPF. Then there's EIGRP which isn't either a distance vector or link state protocol. This protocol belongs to the mighty Cisco. They released it when people were demanding a better version of RIP, so Cisco released this. It's fading away as well. without dynamic routing, the Internet would cease to exist, so appreciate this, cause it make it all possible. I'll refer to the chart on Pg. 259 to give you a description of all the protocols and a couple notes. On that bombshell, thanks for reading, and until next time!

Completion Status: 38%
Pages Left:
- Book: 420 pages
- Chapter: 11 pages

Wednesday, December 9, 2015

Week 14: Day 038 - Routing #3


Hello again, get ready for some more routing today! I will be going over Dynamic Routing today. Here's a new thing I'll be doing, I will give a brief at the end of the entry on how much is left in the book and chapter to motivate myself.

Firstly, Dynamic routing are the protocols given to the router so it can do more things on its own. By this I mean, instead of tediously doing static routing, which is prone to human error, why not just let the router do everything itself? This is essentially what dynamic routing is. A hop is each time a packet goes through a router. If you're using a computer and are on Network ID X, you ping a computer in network ID Y, you go one hop, but if you ping Network ID Z, you go two hops. Routing protocols have been around like any tech, there are many types. The Network+ Test breaks the protocols into three groups: distance vector, link state, and hybrid. There will be a lot covering this, so I will cover it a lot as well.

Routing tables contain metrics. A metric is a value that routers use when they have more than one route to get to another network. Unlike our gateway routers at home, usually more advanced routers will have more connections to a certain network. This is used just in case a route is lost, to maintain a connection.

Here is the textbook's criteria for determining a metric:
- Maximum Transmission Unit: Better known as MTU, this determines the largest frame a particular technology can handle. Ethernet likes to use 1,500-byte-frames. Other technologies use smaller or larger frames. I fan IP packet is too big for a particular technology, that packet is broken into pieces to fit into the network protocol in what is called "fragmentation". Fragmentation is bad because it slows down the movement of IP packets. By setting the optimal MTU size before IP packets are sent, you avoid or t least reduce fragmentation.
- Costs: Connecting to the Internet isn't free. Some connections cost more than others, and some incur costs based on usage.
- Bandwidth: Some connections handle more data than others. An old dial-up connection moves at best 64 Kbps. A cable modem easily handles many millions of bits per second.
- Latency: Say you have a race car that has a top speed of 200 mph, but it takes 25 minutes to start the car. If you press the gas pedal, it takes 15 seconds to start accelerating. If the engine runs for more than 20 minutes, the care won't go faster than 50 mph. These issues prevent the car from doing what it should be able to do: go 200 miles per hour. Latency is like that. Hundreds of issues occur that slow down network connections between routers. These issues are known collectively as latency. A great example is a satellite connection. The distance between the satellite and the antenna causes a delay that has nothing to do with the peed of the connection.

Different dynamic routing protocls will use one ore more of those routing metrics in order to calculate it's own routing metric.

Then there's distance vector routing protocols, which were the first in the TCP/IP routing business. The distance vectors have some form of total cost. The simplest total cost of the hops between the router and the network would be 1, and if it were two hops a way it would be 2. However, not all network connections are equal! A router could have two, one-hop routes to a network each one going at different speeds. The slower one could have, for example, a metric of 10 instead of 1. What distance vectors essentially do, are calculating the total cost to get to a particular network ID, and compare it to the total cost on all other routes. The router will then choose the lowest cost. But for it to work, routers using distance vector must transfer their routing table to the other routers in the WAN. Each distance vector has a max number of hops, which the router will send its routing table to lower traffic. Now it's time to give some examples (to understand the next paragraph, go to Pg. 248-onwards)...

Say you have four routers, all of them have static routes set up between each other (metrics shown.) You add two new networks, one connects to Router A, the other to Router D. Let's call them NIX (Network ID X) and NIY (Network ID Y).  A computer on one network wants to send packets to a computer on the other, but the routers between Routers A and D don't know about the two new network IDs. This is when distance vector kicks in. Because all of the routers use a distance vector routing protocol, the problem is solved quickly. On a certain defined time interval, the routers will give each other their routing tables. Router A sends its route to NIX to Routers B and C. Router D sends its to NIY to Router C. Great, so now Routers B and C know how to get to  NIX and Router C can get to NIY. There is no completed path, between NIX and NIY though. This will need another interval. After another set amount of time, the routers send their updating routing tables to each other. Router A knows a path to get to NIY, and Router D knows a path to NIX. But a side effect, Router B and Router C have two routes to NIX. Router B can get to NIX through Router A and through Router C. But, Router C can get to NIX through Router A and through Router B. What should we do? When the router discovers multiple routes to teh same network ID, the distance vector routing protocol deletes everything except the route with the lowest total cost. Then Routers A and D get updated info about the lower total-cost hops to connect to NIX and NIY. Just as Routers B and C only kept the routes with lowest costs, Routers A and D will do the same, only keep the lowest-cost routes to the networks. Now Routers A and D have a lower-cost router to NIX an NIY. They got rid of the higher cost routes and begin sending data. Routers using the distance vector protocol are not as smart as you think though. They'll just keep sending each other routing tables, even though the information is the same. The routers are then in a steady state (or "convergence), which means that the routing tables have completed. Nothing has changed in terms of connections, and the routing tables won't change. What happens if the route between Routers B and C break? the routers have deleted the other routes, so the connection will go down temporarily, and they'll go through the process all over again! Distance vector routing protocols work fine in a situation with four routers, but it isn't good for large networks. Routers can use one of three distance vector routing protocols: RIPv1, RIPv2, or BGP.

The RIPv1 is the grandfather of all these distance vector protocols. RIP stands for "Routing Information Protocol". The first version is from back in the 80s. It has a max hop count of 15, so you could only have a max of 15 routers. That was a problem because the routing table requests would loop back to the initial router. RIPv1 sent out updates every 30 seconds all at the same time, causing network overloads. To ad don it didn't know VLSM (Variable-length subnet masking.) they also had no authentication which is extremely insecure. Then in 1994, RIPv2 came out. Since then VLSM was added plus authentication, but it still has the same hop count of 15. Basically, RIP is available in all routers, but no one uses RIP anymore, cause its convergence time sucks. The growth of the internet required a better routing protocol.

The one that's widely used today is BGP, which is due to the explosive growth of the internet. Lots of organisations, such as ISOC (Internet Society), IANA, and IETF (Internet Engineering Task Force) were trying to find a standardized dynamic protocol to implement. What ended up coming out of all of this was Autonomous System (AS) which is when one or more networks are governed by a single dynamic routing protocol. These Autonomous Systems do not use IP addresses, but ASNs (Autonomous System Number) assigned by IANA. It was originally 16-bit, but now it's 32-bit. An example of an ASN would be "1.33457". Just like you would assign an IP address to a router, you would configure the router to use ASN, by default ASN is assignment the IANA, however. Autonomous Systems communicate using a protocol called Exterior Gateway Protocol (EGP). the networks within AS communicate with protocols as well. They're called Interior Gateway Protocols (IGP). Neither EGP or IGP are dynamic routing protocols, it's just lingo used by ISPs. Many procols are used within AS, such as RIP. The Internet, however, have settled on one protocol to communicate between AS: the Border Gateway Protocol (BG-4). The Network+ exam objectives have BGP as a distance vector routing protocol, but it's really kinda different. It doesn't give you the same type of routing table. They're are instead manually configured ,and send out info passed to them from different AS' edge routers, which is what AS-to-AS routers are called. Then BGP will forward that info to include ASN and other non-IP stuff. BGP knows how to handle several situations unique to the internet. If a router gives a crappy new route, it will ignore it. BGP is great, is basically what I'm saying. On that bombshell, thanks for reading, and goodbye.

Completion Status: 37%
Pages Left:
- Book: 426 pages
- Chapter: 17 pages

Monday, December 7, 2015

Week 14: Day 037 - Routing #2


Hello everybody, today's entry will not be like it normally is. What I will do in this entry will become a regularity, and the normal entry. Basically, to pick of the pace, I will be doing shorter entries, which end up covering more topics. Anyways, let's get right into it!

Routers, they let you connect to many types of network technologies. They can also connect to anything that stores IP packets. As a typical alternative to Ethernet, people use DOCSIS (Data-Over-Cable Service Interface Specification) or more commonly known as "cable modems" and much less known as, Frame Relay, and ATM (Asynchronous Transfer Mode). These technologies as you can imagine, work very differently from Ethernet. The only thing they have in common is that they carry IP packets within their Layer 2 capsules. Most professional, not home, routers let you add interfaces. To do so, you buy snap in interfaces to fit your needs. If you connect Ethernet to ATM, but an Ethernet and ATM module. While if it's Ethernet to Cable Modem/DOCSIS, buy an Ethernet module and DOCSIS module.

Now, it's time to get to one of the most important, and coolest things of networking. This is called Network Address Translation (NAT) a form of network security. Basically, when you have got something as good as TCP/IP and routers, that's great and all, but it poses a security risk. What will stop a jerk from putting malicious programs on your computer? The IANA assigned it's last IPv4 addresses, February 2011. You now get your IP address from an ISP. Routers all run NAT, which will essentially hide the IP addresses of computers on your LAN, and let you connect to the internet at the same time. This is used all around the world, and I must know more about it! Now let's get this clear, NAT is not routing, it's a separate technology. My textbook gives a hypothetical situation which I will follow here. I have LAN with eight computers which need to access internet. First, I will call my ISP and buy a network ID. Then I will give an IP address to every computer that I want on the network, and then will connect these devices to the LAN of the router. Third, I will assign the ISP router's IP address to my WAN connection on the local routed (ex: 1.2.4.1) All the clients on the network will have the same default gateway. The gateway router acts as the default gateway. That network stlye is how computers in LAN connected to the internet for the first 20 years, but the security issues heightened the more computers were added to the world wide web. Now, NAT fixed these issues, and here's the concept: The router replaces the source IP  with its outside interface address in outgoing packets. The simplest NAT is "basic NAT", and it does just that (translating private IP to global.) Then we've got "dynamic NAT" which in contrast can share a pool of routable IPs fewer than the amount of computers. Like if it had 10 routable IPs for 40 computers. It's known as Pooled NAT as well.

Then there's PAT (Port Address translation) is a form of NAT, the most common, which handles the one-too-many problem. This is how it works. You have a network at your office, it uses private IP addressing of 192.168.1.0/24 and all the computers in the private network will have to connect somehow. It uses a single PAT router, with the global IP address 208.190.121/24 for example. When a machine within the network wants to start a session with an external machine, it uses the source and destination IP, and port numbers for the TCP or UDP datagrams, which are then recorded in the PATs translation table, and the private IP gets swapped for the public IP on every packet sent. The port number is used by the internal computer for the session, and is translated into a unique port number for the router. Then when the receiving system sends the packet back,  the IP addresses and ports are reversed. The PAT router then compares the incoming destination port and source IP to what's in the NAT translation table, so it can decide which IP address to put back on the packet.The packet is then sent to the correct computer. This whole mapping enables perfect tracking of what goes in and out. PAT handles many internal computers with one public IP address, because the TCP/IP port is big. The TCP/IP port literally has values ranging from 1 to 65535. Some of those port numbers are common, but many are available for PAT to do its job. Since the router is revising and sending the packets, why not enable it to handle ports? This stage is called port forwarding.
But... I ALREADY KNOW PORT FORWARDING! HAHA! Because of this, I will not go over it. However a couple of things to note, port forwarding is when a specific local address is designated for network services. Port 80 is for HTML (kind of already knew that...just in case.) Finally you should configure NAT on home routers. By default the router is set to Gateway, which means "NAT is turned on." Mike Meyers says "If I wanted to turn of NAT, I would set the radio button to Router." okay, sir. That ends my entry for today, thanks for reading. 

Friday, December 4, 2015

Week 13: Day 036 - Routing #1


Hello once again! Today we're starting a new chapter on routing. We'll be covering a lot of stuff about how routers work, including NAT, I'm not going to tell you what the acronym represents until later, cause we'll find out soon enough. Let's get right in!

Firstly, as we all know a router is hardware that forwards packets. Because of this, routers are classified in the Network layer of the OSI model, and the Internet layer of the TCP/IP model. Routers generally have at least two connections, but they can contain way more connections than that. In an office you may find the Cisco 2600 series device, which is one of the most popular routers ever made. Although it might be an old router, it's durable, and reliable. Cisco just has a way of doing that! One port within these routers leads to one network, while the other connection (port) leads to another. The router reads the IP addresses of the packets and determines where it should send the packets.
The majority of techs nowadays deal with home routers which are meant to connect to DSL or cable modems. The typical router will combine the router and the switch, while also providing DHCP and a firewall. Routers are great! The LAN side of say for example, a Linksys home router will connect immediately to the built-in switch. Because of this, it's not necessary to connect multiple computers into a separate switch which you would have had to buy to connect it to the the cable modem or DSL receiver. Some would look at the said router, and think that since it may have for example, 6 ports, that it would connect to 6 different networks. In reality, it can really only connect two networks. Yhe extra physical ports are part of the built-in switch. All routers will examine packets and send them to their destination, so let's see how!

Routing starts with packets which go to the router awaiting further transport.  Basically, the router will discard any information from Layer 2 and will drop the IP packet which was inside it, into a queue. The router doesn't discriminate, so it doesn't give a crap where the packet came from. It just unpacks the packets and drops it into a queue. The router then reads each packet's destination IP then sends it straight there, through the correct port. To perform such an inspection, the router has a something called a "routing table" which tells the router where it should send packets. As we established before, the router has two ports internally, one which connects to your ISP. This is called WAN in the routing table. Then there is another four ports which is the built in switch, and that's connect to LAN. Here is an example of a routing table:

Each row defines a single route. Each column specifies criteria. Here's the meaning of the columns that you see above, according to my textbook.

- Destination LAN IP: A defined network ID. Every network ID directly connected to one of the router's ports is always listed here.
- Subnet Mask: To define a network ID, you need a subnet mask
- Gatway: The IP address for the next hop router; in other words, wher ethe packet should go. I fhte outgoing packet is for a network ID that's not directly connected to teh router, the Gateway column tells the router the IP address of a router to which to send this packet. That router then handles the packet and your router is done. If the network ID is directly connected, then you don't need a gateway. Based on what's needed, this is set to 0.0.0.0 or to the IP address of the directly connected port.
- Interface: Tells the router which of its ports to use. On this router, it uses the terms "LAN" and "WAN". Other routing tables use the port's IP address or osme other type of abbreviation. Cisco routers, for example use f0/0, f0/1 and so on.

The router looks at its destination IP, then proceeds to consult the routing table to see which device will receive the packets. Some routers read the table top-down and some bottom-up. One trick when reading a routing table is to think, every zero you use means "anything". Like if you saw the IP 10.12.14.0, compare that to subnet mask 255.255.255.0 you'll see that it's a /24 network ID and that any number between 1-254 for the last value will work. Continuing, every router has a default route. For example, it may forward it to 76.30.4.1 by default, through the WAN port. It's important to have a default route cause it's a guide for the router with what it may do when it receives an incoming packet. Sometimes though, if you decide to add another line to the routing table, it will give another route. One important thing to note is that not only Routers use routing tables. You'll find them on just about every device which is connected to the network. You might ask why they have them. It's because the NICs and the other devices need to know the IPs coming in and going out. Here's what a routing table looks for Windows:


Not much different than a home router, it just usually has a lot more routes. The interface has an actual  IP, and a loopback, instead of LAN protocol. In the world of routing there is something called "metric", this is part of the beauty of routing because a metric is a value which defines the cost of using a certain route. Lowest routes always win. The router will always use a metric of 1 unless it stopped working for some reason. If it were to stop work it would switch to the 10 metric. That's basically how the internet works if you think about it. A bunch of routers connected to even bigger, more powerful routers. Connections will go up and down all the time , so routers are constantly talking to each other. Let's try to make out what the routing table is saying. The bottom line defines default IP broadcast (it doesn't matter whether the default ip starts bottom or top). The next line up is the multicast address range. The next route say sthat any adress in the 147.100/16 network ID are part of the LAN. If your computer DHCP client isn't receiving an IP address, this route would enable you to communicate with outer computers on the network which may have the same problem. The next line is a loopback, and the line after that is the directed broadcast. The next line means anything addressed to the machine goes to the loopback. Then the one after that defines the local connection. Another note, local connections do not use default gateway, but every routing table still has a gateway column. This is because Microsoft had to put something there, so they just put the IP address of the NIC. In Windows 7 and I assume further, the gateway value for local connections says "on-link". FINALLY, the top line deifnes the default route. On Windows use PuTTY and then type the command "show ip route" and it's pretty self-explanatory what it does. The last three lines will be the routing table. That's basically how you look at routing table, and actually understand it. In the end what they basically do is list the routes so the IP packets can be moved to the correct interface. On that note, thanks for reading, and until next time!

Tuesday, December 1, 2015

Week 13: Day 035 - TCP/IP Basics #6


Hello everybody, today is the day when I finally end this chapter! This entry will mainly focus on using IP Addresses. One thing to note is that next chapter will cover a lot important stuff about routing. Let's dive right in.

Funny enough for me, I already know a lot of the stuff that's about to be covered. This is static addressing vs. DHCP which is although is obvious to me now, perhaps I may forget! Basically to make the network function, each computer must have an IP address, subnet mask, and a default gateway. First I must decide what network ID I want to use. Back then, you were given a bloc of IPs, so I'll just pretend that I was given a Class C license of 197.156.4/24 in this scenario. The main rule of network addressing is that I can do whatever the heck I wanna do with my network ID. The only other rules are fairly obvious, every computer has to get a legit IP and subnet mask for my network ID. Also another thing, every IP on the network must be unique. I don't have to go in numerical order when distributing the IPs, but a lot of people do cause it's easier to identify the computers. Most networks follow these principles:

1. Give default gateway the first IP address of network ID.
2. Try to put them in numerical/sequencial order.
3. Attempt to seperate servers from clients.
4. Write down what you've decided, so your successor will understand.

Although those standards are unofficial, it's convenient, and much appreciated to whoever succeeds you as network admin. At this point you can give each and every device on the network an IP address, subnet mask, and default gateway.
Usually you'll find on the operating system you're using, the static IP information. On Windows, which I'm a million times more familiar with, there is the Internet Protocol Version 4 (TCP/IPv4) Properties dialog. Next on Mac OSX there is the Network utility in System Preferences. Then on Unix/Linux systems there is the command-line ifconfig commands. Thankfully most distros provide a GUI, which I prefer, and it's usually called Network Configuration. When you've added the IP info, you should verify using the ping command. This is the basis of Static addressing, and it's still used a lot. However there is something much simpler which is more widely used, as the average user is not as well versed as a network administrator.

This is called "Dynamic Addressing" or better known as "Dynamic Host Configuration Protocol" (DHCP), and if your old then Bootstrap Protocol (BOOTP) which is no longer used. Basically what DHCP does, is distribute IPs to the computers on the network automatically, which makes things a lot easier! When a computer is configured to use DHCP, it's called a DHCP client. When a DHCP then boots up, it sends out a DHCP Discover packet which uses the broadcast address, which was used by other functions earlier in my entries. What the message essentially say is, "Are there any DHCP servers out there?" as my textbook puts it. However, for all of this to work, one system on the LAN has to be running DHCP server software. It's designed to respond to DHCP Discover requests while also providing a response to those requests. The DHCP server hands out IP addresses from a range and subnet mask. It pass out other information as well, known as options which have many choices such as default gateway, DNS server, network time, etc. To me, the most popular DHCP server I know of, is by far Windows Server 2008.

The acceptance from the DHCP client of the DHCP server's data is a DHCP lease. The DHCP lease is set for a certain amount of time, ranging from five to eight days. It renews it after that amount of time, unless some other device took that lease, or if the said device is no longer connected to the network. The biggest problem that can happen regarding DHCP, is if a DHCP client does not receive an IP from the DHCP server. You can figure this out through some kind of error on the OS or maybe through finding out that the IP is something weird.
That weird looking special IP is created by APIPA (Automatic Private IP Addressing). All DHCP clients are designer to generate one of those addresses automatically, if no DHCP discover message is received. However APIPA can't issues a default gateway, so you can't get on the interpet using APIPA, you can only do LAN activities. When you can connect to local computers but not the internet, that gives you a big clue as to what the DHCP problem is. One way of fixing it is by reestablishing a DHCP lease, but manually. Every OS has an application which does it for you. For example, on a Mac you'd go onto System Preferences and use the Network utility to find it, which on Windows you'd type the command "ipconfig /renew". Sometimes that won't work on Windows, so you'd force it! Basically you'd type "ip config /release" followed by "ipconfig /renew" into Command Prompt. In Unix/Linux use the ifconfig command to release and renew the DHCP address. You would type "sudo ifconfig eth0 down", and then to renew "sudo ifconfig eth0 up". The reason you use sudo for that is cause you need root privileges.

Finally, the creators of TCP/IP created some special IP addresses that are important to know about. The first one is 127.0.0.1 aka the "loopback address". If you were to try to send data to that IP, you'd be sending yourself data! It's main use is to use the ping command with it, a test as to whether your NIC is capable of sending and receiving packets. A lot of people try to hide themselves from the internet by using Private IP Addresses. Routers usually destroy Private IP Addresses after they're done being used. The catch to these Private IPs is that they're useless on the internet... unless you use NAT! Before I go, take a look at these ranges of addresses designated as private IPs:
- 10.0.0.0 through 10.255.255.255 (1 Class A license)
- 172.16.0.0 through 172.31.255.255 (16 Class B licenses)
- 192.168.0.0 through 192.168.255.255 (256 Class C licenses)

One last thing, be expecting talk of NAT next chapter! On that bombshell, thanks for reading, and goodbye.


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.

Thursday, October 29, 2015

Week 8: Day 025 - Installing a Physical Network #7


This is it folks, the end... today I will finally finish this chapter! After like 50 something pages of this, the end is here. Today's entry won't be the familiar long ones you usually see, cause there aren't that many pages left. To be brief, there's only one section left. The next chapter, may be about the same length, but I will hopefully get through it quicker.

Firstly, this final section is about Diagnostics and the (sigh) Repair of Physical Cabling. So first, if your network fails, you gotta diagnose the issue! Usually when it tells you that "No server is found" or network explorer/network is being used by the OS to find the issue, then it's a physical problem. First you should try to rule out software errors. It's pretty easy, if one application is working, and another isn't, then bam, it's a software problem. When the systems fail to access the network, then it would be a good idea to suspect the switch as the issue. Also, throwback to the link lights, that's also one of the best tools you have in diagnosing the problem. If the lights aren't on, somethings not connected. If the machine is isolated in its issue, compared to other devices, then you know it's not a problem with the switch. Sometimes a good idea is to bring a patch cable to plug the system into a good outlet. Next, you would obviously check the NIC at some point. A bad NIC can be the cause of the "can't see network" problem. Using the utility on your operating system is a great tool in seeing if you have a bad NIC. The female connector is many times the root of the problem there. To test that, the NIC has the "loopback test". Despite the tediousness, it's important to remember to check all these things.

Although many of the problems are in the work area, sometimes you'll find that the horizontal cabling is to blame. To test this, you'll need a mid-range tester. Patience is a big requirement for this, and I'll be honest, I'm not a very patient person. Important note, always include the patch cables in the test. If the problem is horizontal cabling, it's hard to fix, so just replace it haha. In the TR (Telecommunications Room) you'll find that it's a big maze, even if it's organised. The punchline here is test every cable, don't skip a connection. All the boxes need a good amount of power, which is a big concern for your TR. What these power supplies are called, is UPS (untierruptible power supply) no, not the postage company! A "voltage event recorder" is useful for these things, because if you lose power to them, it will record what the issue is with the UPS. The temperature in the TR should also be monitored just in case it gets to hot and your computers overheat. One way of doing this easily, is with a "temperature monitor". As for humidity and other stuff use an "environmental monitor".

Finally, let's be honest, there will come a time during the construction of a network, when something goes wrong when organizing, and maybe later on you'll regret it. For example, if a label falls off, or if you miscount the amount of rows. A lot of things could go wrong in that aspect, and you should be ready for it. When you must trace a cable, there is a device called a "toner" which helps with this. However, this word is a reference to two different devices. The "tone generator" and the "tone probe". To trace a cable, connect the tone generator to the end of the cable, and then the tone probe to the other end of the cable. This will test the cable, and hurrah you're finished! Haha, SO AM I. This chapter is over, done, Get ready for some TCP/IP next time!!! Thanks for reading, and goodbye.