Posts

Showing posts from 2021

Number Systems

Image
Decimal number system - base 10 deci -> 1/10 0 1 2 3 4 5 6 7 8 9   Binary number system - base 2 0 1 0 --> off            1--> on Octal number system - base 8 Octagon 0 1 2 3 4 5 6 7  Hexadecimal number system - base 16 Hexagon hexa + decimal = 6 + 10 =========================================================================                                Convert Number Systems ========================================================================= 1) Decimal -> Binary 2) Decimal -> Octal 3) Decimal -> Hexadecimal 4) Binary -> Decimal 5) Binary -> Octal 6) Binary -> Hexadecimal 7) Octal -> Decimal 8) Octal -> Binary 9) Octal -> Hexadecimal 10) Hexadecimal -> Decimal 11) Hexadecimal -> Binary 12) Hexadecimal -> Octal ----------------------------------------------------------------------------------------------------------------------------- 1) Decimal -> Binary There are two ways to do that, the first method is                          

CIDR Notation / Network Prefix

Image
  Classless Inter-Domain Routing -CIDR ========================================================================= SID = Subnet ID, HID = Host ID, NID = Network ID =============================================================== There is a simple scenario of CIDR, 192.240.10.0/28 1) Network id bit ?      This is class C ip. So network id have first 3 octet in ip. I t is 24 bits. NID = 24 bits 2) Subnet id bit ?      CIDR = 28  = NID + SID = 24 +4       Then SID = 4 bits 3) Subnets ?      We can find the subnet count by SID count       SID = 4 bits, So 2^4 = 16      So there are 16 subnets 4) Host id bit ?      All ip bits - (NID + SID)     32-28 = 4     4 hosts 5) Address count ?     This depend on host id bits count,     HID = 4, So 2^4 = 16 6) Host count ?     NA = Network Address, BA = Broadcast Address     All IP host bit Count - (NA +BA)     16 -2 = 14 7) Subnet Mask ?     we can find the subnet mask by adding value 1 for NID, SID and adding value 0 for HID.     CIDR = NID + SID    

Subnetting with Class C, Class B and Class A

Image
 Class C with subnet 8 Class B with subnet 128 Class A with subnet 1024

Custom Subnet Mask

Image
We can get a custom subnet mask by adding 1 value to the subnet bits and adding 0 value to the host bits. This is a chart of the custom subnet mask.

Subnet ID

Image
If any requirement to subnet some network, we must need the subnet id. Subnet id use for identity which subnet in the network. we get an example scenario here. There is an ABC company. That company have 4 divisions.  So that network wants 4 subnets. but how to apply subnets to the computer. It`s also doing by bits. 1 bit have 0 and 1. So there are two IDs . In this scenario, we want 4 subnets. Then we want 4 IDs. since we need 2 bits  1 bit =0, 1 2 bit = 00, 01, 10, 11 how to include subnet id into the IP address. if we get a class c address as 192.168.10.4, this IP network id can not change, only the host id can change. So we book some bits for subnet id from that host id. Subnet      Subnet ID   (2 bit) D1             00 D2             01 D3             11 D4             10 D1 (00) 192.168.10.00 000000  (192.168.10.0) Network Address 192.168.10.00 000001  (192.168.10.1) 192.168.10.00 000010  (192.168.10.2)                  | 192.168.10.00 111111   (192.168.10.63) Broadcast Address  

Default Subnet Mask, how PC detect network address

Subnet = simply when a network divided into several parts or sections, then each section also have a network. that one section call subnet. The default subnet mask is used to identify the network address to the computer. Because the computer can not think network address if we give an IP address to the computer. it's only thinking with bits. it's explained later in this post. First, we look at the changes of the default subnet mask with IP address classes. *note:-  if there are no subnets more than 1, then use the default subnet mask Theory: Network Id get 1 value, Host Id get 0 value Class A ____.    ____.____.____ Net ID  Host ID    |               |       |       |   1              0      0      0 255.      0.0.0 default subnet mask = 255.0.0.0 Class B ____. ____.    ____.____ Net ID            Host ID    |        |                |      |   1       1               0     0 255.255.     0.0 default subnet mask = 255.255.0.0 Class C ____. ____.____.     ____ Net ID           

ID Usage, Network and Broadcast address, IP range and Host count

For explanation, we get an example of an IP address 192.168.10.32 In an IP address, there are two main parts. one is network id and another one is host id. Network ID = NID, Host ID = HID These ID change with IP address classes Class A 10. 11.12.65 The first octet is NID. Last three octet is HID NID =  8 bit , HID = 24 bit Class B 129.160 . 34.62 The first 2 octet is NID. Last 2 octet is HID NID =  16 bit ,  HID = 16 bit Class C 192.168.10 .32 The first 3 octet is NID. Last octet is HID NID = 24 bit ,  HID = 8 bit This IP address has a network address and broadcast address Network address  = This address helps to identify the network from other networks.  (192.168.10.0) Broadcast address  = This address used to sending a message to all devices in a network or broadcast a message to the network.  (192.168.10.255) Can not use network address and broadcast address for hosts. (for pc) If we get 192.168.10.32, we know that is a class c IP address. so the last octet is the IP range of this I

IP Address Classes

 IP Address Classes There are several classes like A, B, C, D, E. Most A, B, C class use for our networks. Class D, E use for Other network-related work and for research. Class A [0] [0-126/127] As we write IP in X syntax, xxxxxxxx.__.__.__  the IP class define in the first octet.  The first bit must be 0 in the first octet. 0xxxxxxx.__.__.__ So, we can define below as, Class A first Address (lowest value in binary)  00000000 2 Class A first Address (lowest value in decimal) = 0 Class A first Address first IP = 00000000.00000000.00000000.00000000 = 0.0.0.0 Class A last Address (highest value in binary)  01111111 2 Class A first Address (highest value in decimal) = 127 Class A first Address last IP = 01111111.11111111.11111111.11111111 = 127.255.255.255 The class A highest value in decimal    0     1     1     1      1  1   1   1 2 128+ 64+ 32 +16 + 8+4+2+ 1        0+127 = 127 Same mechanism to other octets Finally class A ip range is 0.0.0.0 - 127.255.255.255 but the 127 ip range is sp

IPv4 Address

Image
Network Address There are two types of network addresses  Logical Address    IP Address  Physical Address    MAC Address (48bit)  /Media Access Control IP =Internet Protocol Protocol in networking = Set of standard rules to communicate with each other. There are two versions of  IP IPv4 (32 bits) IPv6 (128bits) So we mainly talk about IPv4. The IPv4 have 32bits. It's separated by 4 octets. One octet has 8 bits. 1 byte = 8 bits 32 bits = 4 bytes Octet  Lowest value in binary = 00000000    Octet  Lowest value in decimal = 0 Octet  Highest value in binary = 11111111     Octet  Highest value in binary = 255 How that's 255 comes in decimal value? Then, the octet range in decimal 0-255