IP adresses version 4
IP is an internet protocol.
   IP version 4 demystified:
IP address (number separated by dotes) comes with:
  - IP address: consist of 4 octets long (32 bits)
  - Subnet Mask: a series of 1 followed by a series of 0.
  - Gateway
To converse an octet to a decimal number:
 128      64       32         16     8          4           2   1
Where ever we put the ones we add the number it
corresponds.
  o IP address can take numbers from 0-255.
  o The series of ones and zeroes in the subnet Mask
    separate the Network part (on the left) and the Host part
    (the one on the right).
  o The IP address and Gateway need to be in the same
    Network.
  o The first octet of the IP address defines which class it’s in
    it.
  o The class defines the subnet Mask.
The first octet of IP between                       class
            1- 126                                    A
           128-191                                    B
           192-223                                    C
     o How many valid IP addresses are there in that network:
       (2^number of host bits) – 2
Class C :
IP address                     192.168.100.225 /24
Subnet Mask                    255.255.255.0
Gateway                        192.168.100.1
Network Id (First)             192.168.100.0
Broadcast Id (Last)            192.168.100.255
Valid IP address (Start)       192.168.100.1
Valid IP address (End)         192.168.100.254
Number of valid IP addresses   2^8 – 2 = 254rooms/hosts
Class B :
IP address                     172.123.100.225 /16
Subnet Mask                    255.255.0.0
Gateway                        172.123.1.255
Network Id (First)             172.123.0.0
Broadcast Id (Last)            172.123.255.255
Valid IP address (Start)       172.123.0.1
Valid IP address (End)         172.123.255.254
Number of valid IP addresses   2^16 – 2 = 65534
Class A :
IP address                     100.228.111.225 /8
Subnet Mask                    225.0.0.0
Gateway                        100.101.123.1
Network Id (First)             100.0.0.0
Broadcast Id (Last)               100.255.255.255
Valid IP address (Start)          100.0.0.1
Valid IP address (End)            100.255.255.254
Number of valid IP addresses      2^24 – 2
           Subnetting:
Class C:
Subnetting is breaking down a large network and treating
them as separate networks.
We have 2 types of IP addresses: Private and public IP
addresses.
   Private ones cannot go on the Internet; they can only
    travel on your local network. They are sent to routers
    that are connected to the computers.
   Subnetting deals with the classless IP addresses.
   Version 4 IP addresses were designed so the computers
    on the Internet will have separate unique IP addresses.
   Version 6 IP addresses were designed, because they ran
    out of version 4 IP addresses.
So to break a network into 2, we borrow a bit from the host.
Then we find the network ID and the broadcast ID.
Similarly, if we want to break it in 4, we borrow 2 bits from the
host part. => Only with multiples of 2.
But, if we want to break it in 3: we can break it in 4 or break it
in 2 then break one part in 2 so we got 3.
 The block size = the place value of the last 1 we borrowed
  from the host part.
 So 256/the block size= the number of subnets we could
  have.
 The hosts in each subnet = 2^(number of 0 in the host
  part) – 2.
 CIDR = number of numbers of the Network part.
 If we have 62hosts in the first subnet then: the network
  ID ends with 0 and the broadcast ID ends with 63.
 When we want to determine the broadcast ID in class B,
  we work as the digital clock works. 2h59mn59s + 1 =
  3h00mn00s.
           Supernetting:
   Supernetting is the opposite of subnetting, and they are
    complimentary.
   Supernetting is used in the routing concept.
   We take smaller networks and combine them into one big
    network. ( by listing one network Id that combines all the
    network Ids)
   In the supernetting, the routing table is summarized, so
    that the listings are reduced. And that’s the secret of the
    Internet. ( It summarizes the IP ad to run efficiently.)
   If we want to summarize a bunch of IP ads into one IP ad:
    - We work on the octets that change.
    - We convert it into binary and work in the bits that
       change.
    - Then we make everything beyond that line as 0.
- We also change the CIDR by counting the bits that
  haven’t changed (which form the network part).