Sunday, March 25, 2018

CIDR


Source:
https://www.youtube.com/watch?v=m7osap3K_MU&list=PLjrF25Df7idwxvJzLpECBc2rZjQLOazgV&index=3

CIDR Notation
Classness interdomain routing
its the way we write out ips without the subnet mask

Its nothing but an ip written out without the slash and the Number

The slash and the number is called the ip prefix or the network prefix

Example A:

192.17.15.6/18  <--- This is CIDR notation

18 means , the first 18 bits are the network address ( 18 1's )

11111111.11111111.11000000.00000000    < --- We write down the 18 1's  and the rest of them are zeroes
Convert that from binary to decimal, you will end up with subnet mask
255.255.192.0 
This is a class B
Technically - its a 192 , 192 is a C , so its a class C subnet
#--------------------------------------------------------------------------------------------------------------

Example B:
190.75.18.70/25    < ---- CIDR Notation

25 1's
11111111.11111111.11111111.10000000
255.255.255.128   --- < This is the subnet MASK
This is a class C


Anything that is not a 255 ends up being your host.


#---------------------------------------------------------------------------------------------------------------

Given the IP Address and the CIDR   find the following

1) Network ID
2) First Host - The
3) Last Host
4) Broadcast Address
Inside of that subnet, what address broad casts to every ip inside of that subnet ?

The machine need not have a network ID
The network ids are typically held by routers

You need a router when connecting between two networks.
For within the network, you need a switch.


We have an ip address of  195.251.117.155/25   { 25 is the CIDR }

Once defined the Network id, the first number the work station can have, the last number the work station can have

No workstation can hold the network id or the Broadcast Address
You dont want them to have them
Network IDs are typically held by the routers.

1) First thing is to convert the CIDR notation into classful MASK
We are going to turn it to binary and figureout what our subnet is

25 1's   So we come up with

11111111.11111111.11111111.10000000
255.255.255.128   <  -- This is our subnet MASK


2) We have to find what is called the increment.
What is the last place that  LAST 1 SITS in ?

The last 1 is in the  128th column, so the increment is 128    i = 128

3) Find the networks, where the ip fits /sits in ?
LIST the networks until you find the correct network.

195.251.117.0   ---
Then we add 128 to it
195.251.117.128

Adding 128 to the above subnet gives us the next range
Now we cant go any higher,  195.251.117.256  - This cant be done as the end of the subnet is 255

So now we know  195.251.117.155 is part of    195.251.117.128  Subnet

So our Network ID is    195.251.117.128

Ths 128

The first ip our work stations can hold is 1 number higher that is 129

195.251.117.129

4) The last ip is 2 digits lower than the end of the network
In this case it is going to be 254

195.251.117.254



5) The broadcast address is 255
195.251.117.255

No machine needs to have this number  195.251.117.255   < ---

If a machine has this number  195.251.117.255,  then it is going to broadcast to all the hosts between 128 and 255, we dont want that


No comments:

Post a Comment

netstat

A copy from there - TCP Connection States 
 Following is a brief explanation of this handshake. In this context the "client" is ...