After posting about the Internet, my plan was to post about "Networking Devices" (those devices which make up the Internet). But then I thought of firstly giving you the idea of basics of networking. So here we are, with the next topic of "Networking Basics". Now if you don't know what a Network is, then you may have a look at this.
IP Addresses are Important!
IP Addresses are the core of networking. Without IP Addresses we can't even think of sending information from one device to another. Now, I am gonna explain this topic by keeping thing to their simplest level. We'll talk about some advanced stuff later.
If a device is connected to a Network, then this device will have an IP Address assigned to it. Think of IP Addresses as house addresses. If you want to send a letter to your friend, you write the receiver's address on it so that it can reach where it has to. And remember, every house address is unique (at least in a locality or in a society). Same is the case with IP Address. Each device on any Network has a unique IP Address, so that it knows how to communicate with other devices within the network. Also keep in mind that if any two devices on the same network has same IP Address, then this leads to what we call "IP Address Conflict". Both the device will lose their networking capabilities until this problem is solved.
An IP Address consists of 4 numbers separated by 3 decimals. But the beauty of IP Address is that it is separated into a Network Address and a Host Address. Means that one part of the IP Address identifies the network ID and the other part identifies the host ID. Let's take an example. Suppose an IP Address of 192.168.1.7, it is a class C IP Address (we'll talk about IP Address Classes in next section). What class C means is that the first three numbers identifies the network ID and the last one number identifies the host ID. So the network ID would be 192.168.1 and the host ID would be 7. A very important point to note is that devices can only talk to other devices if they are on the same network (i.e The network ID should be the same). So for example, a device with IP Address 192.168.3.32 can talk to a device with IP Address 192.168.3.44 but neither of them can talk to a device with IP Address 192.168.5.65.
IP Address Classes
There are five categories in which IP Addresses are classified and we call those categories as classes. But here we will only discuss about first 3 classes because that's what are important.
Class A IP Addresses
If an IP Address is of Class A type, then the first number identifies the network ID and the last remaining three identifies the host ID. A Class A IP Address consist of the first number ranging from 0-127 (including both). So an IP Address of 126.15.7.2 can communicate with an IP Address of 126.18.4.9 but either of them will not be able to communicate with 125.23.6.6.
Class B IP Address
If an IP Address belongs to the Class B, then first two numbers identifies the network ID and the remaining two identifies the host ID. A Class B IP Address consist of the first number ranging from 128-191 (including both). So an IP Address of 129.66.42.3 can communicate with an IP Address of 129.66.54.9 but neither of them can communicate with an IP Address of 129.34.56.7.
Class C IP Address
The Class C address is familiar to us. If an IP Address is of Class C type then it means that the first three numbers identifies the network ID and the last number identifies the host ID. In Class C IP Addresses, the first number ranges from 192-223 (including both). Once again as an example, the IP Address of 192.168.0.1 can communicate with an IP Address of 192.168.0.6 but either of these cannot communicate with an IP Address of 192.168.1.3.
Replacement for Classes: Subnet Mask
Subnet = "Sub-NETWORK". So subnet means a part of a Large Network (maybe the Internet). So it is legal to use the work "network" instead of "subnet".
IP Addresses changed after the introduction of Subnet Mask. IP Addresses became classless. So it means that you can make a Class B IP Address turn into a Class A IP Address just by altering the subnet. But wait! "What does Subnet Mask means and how does it work?". Well, Subnet Mask is actually a rule. And the rule says that wherever there is 255 in the Subnet Mask, then the corresponding number of the IP Address is part of the network ID and where there is a 0 in the Subnet Mask, then the corresponding number of the IP Address is the host ID. But as always examples are easier to understand, so here is one. Suppose there is an IP Address 192.168.1.2 with Subnet Mask 255.255.255.0, then the first three numbers (of the IP Address and not of the Subnet Mask) is the network ID and the last remaining number is the host ID. So any other device can communicate with the above IP Address as long as the other computer has the IP Address starting with 192.168.1 and have the same Subnet Mask.
Routers
As I told you that for two devices to be able to communicate with each other, they have to be on the same network. Two devices each on different networks cannot communicate with each other. But then there is a 'device' which breaks the above said rule and allow your device to communicate with a device than is not on your network. And that device is known as a "Router". So you can only communicate between networks as long as there is a Router between them. Without a Router you cannot communicate with a device which is not on your network instead you can only communicate with those devices which are on your network and that does not require a Router. Now I am stressing on this point because this is very very useful if you want to understand Routers.
What Routers are is basically just a box generally with two network interfaces (NIC's). The Router will be on a separate network ID on each NIC. So if you have two networks 192.168.1.x and 192.168.2.x and if they are connected to the Router, then the router will have different IP Address on each NIC depending on which network the NIC's are connected to. So in this case on one NIC the Router will have an IP Address 192.168.1.1 and on the other NIC it will have an IP Address of 192.168.2.1. So now devices on the 192.168.1.x network can communicate with those devices on the 192.168.2.x network via the Router (more on Routers in the "Networking Devices Post").
What Routers are is basically just a box generally with two network interfaces (NIC's). The Router will be on a separate network ID on each NIC. So if you have two networks 192.168.1.x and 192.168.2.x and if they are connected to the Router, then the router will have different IP Address on each NIC depending on which network the NIC's are connected to. So in this case on one NIC the Router will have an IP Address 192.168.1.1 and on the other NIC it will have an IP Address of 192.168.2.1. So now devices on the 192.168.1.x network can communicate with those devices on the 192.168.2.x network via the Router (more on Routers in the "Networking Devices Post").
Default Gateways
The Default Gateway is where your device sends the information if it doesn't know where to send it. The Default Gateways can be Routers, Other Devices or Servers etc.
When a device tries to communicate with a device on the same network, then it sends the data directly to it since it knows where to send the data. But when a device tries to communicate with a device which is not on the same network, then it sends the data to the default gateway which is a Router in this case. It is because the device doesn't know where the other device is because they both are not on the same network. But since Router knows where both the devices are, so the device sends the data to the Router, the Router then forwards the data to it's destination. That's why you need a Router if you want to communicate between networks! Remember that you always put the IP Address of the Router in the Default Gateway field. "But what if the Router doesn't know where the destination device is?". Well then, it sends the data to it's Default Gateway. Yes! Routers also have a Default Gateway. So suppose the destination device is somewhere far from you (far from your closest networks), then the Data makes it by jumping from Routers to Routers until it finally reaches it's destination. Routers do their job! You enjoy!
DHCP
As mentioned earlier, every device has to have an IP Address, Subnet Mask and a Default Gateway. "But who does this job of assigning all these things to these devices?". It is actually the job of something called "DHCP" which stands for Dynamic Host Control Protocol. When any device on a network boots by a process called DHCP, then the device automatically gets an IP Address, a Subnet Mask and a Default Gateway. Imagine doing this on your own? Headache?
No comments:
Post a Comment