IP Address - Download as DOC by hcj

VIEWS: 426 PAGES: 18

									      IP Address

           W          .     X        .      Y       .     Z

      ||||||||.||||||||.||||||||.||||||||                         (8X4=32 Binary Bits)


      0 - 255         . 0 - 255 . 0 - 255 . 0 – 255 (Decimal)
      In a network segment, a host IP can not end in 0 or 255:
          0 identifies the network segment (W.X.Y.0)
          255.255.255.255 is reserved for broadcasting

      Range of IP addresses (Soon to debut: IPv6 – 64 Bits)
                                                                               Reserved
 Class          Internet IP Addresses       Reserved (Internal) IP Addresses    network
                                                                               addresses


Imad Khadduri                Windows 2003                                                  1
Class A     1.0.0.0 – 126.0.0.0             0.0.0.0 (Default Route Address,all     1
                                            internet)
                                            10.X.X.X (Internal – Office/Home)
                                            127.0.0.1 (Loopback)
Class B     128.1.0.0–191.254.0.0           172.16.0.0-172.31.0.0                  16
                                            169.254.X.X (APIPA)                    254
Class C     192.0.1.0–223.255.254.0         192.168.X.X (Internal – Office/Home)   254

      GE (3.0.0.0), IBM (9.0.0.0),                 Apple (17.0.0.0),       MIT (18.0.0.0)

An IP address is like a street address, e.g. 510 Main Street, the Network (or
   Main Street) and a Host (or House number 510).

The subnet mask identifies what part of the IP address represents the Network,
   and what part the Hosts on that network.

The Default Gateway is the door that gets you to another network segment; the
    default gateway is usually assigned as w.x.y.1 .

Imad Khadduri                Windows 2003                                                   2
                                  Default
                                  Gateway
                        198.162. 1 .1
                                                 Router     Default
                                                            Gateway
                 Hub

                                           198.162. 2 .1          Hub

         A                        B

                                                  C                     D
       198.162. 1 .14    198.162. 1 .20
       255.255.255 .0    255.255.255 .0        198.162. 2 .7 198.162. 2 .12
                                               255.255.255 .0 255.255.255 .0




Imad Khadduri               Windows 2003                                       3
      IP Subnetting:
      Classfull: simple, not flexible
      The IP addresses were separated into three classes and it was easy to determine
      your subnet mask.

                IP range                 Number of      Number of    Subnet mask
                                         Networks       Hosts

    Class A     1–126.0.0.0              126            16,777,214   255.0.0.0

    Class B     128-191.X.0.0            16,384         65,534       255.255.0.0

    Class C     192-223.X.X.0            2,097,152      254          255.255.255.0


    Class D     224 – 239.0.0.0          Multicasting

    Class E     240 – 255.0.0.0          Reserved




Imad Khadduri                 Windows 2003                                              4
      Classless Inter Domain Routing: CIDR
      Complex yet very flexible

      Once I have an IP (Class A, B or C),
    Class A
    |||||||| . |||||||| . |||||||| . ||||||||
    11111111. 00000000. 00000000. 00000000       ← 0s are host bits
    255 .        0 . 0 .               0
    Class B
    11111111. 11111111 . 00000000. 00000000     ←
     255 . 255 . 0 .                    0
    Class C
    11111111 . 11111111 . 11111111 . 00000000   ←
     255 . 255 . 255 .                  0
Can I use some of the Host bits to get more Network segments, by using an
appropriate Subnet mask?

Imad Khadduri                     Windows 2003                              5
Procedure to follow for solving all subnetting problems

-   How many networks do I need (how many bits we need to set aside for it)?
-   How many hosts do I need (how many bits we set aside for it)?
-   We then determine what the corresponding subnet mask should be
-   Check to see how many networks do I get, and how many hosts do I get?
-   Finally what are the address ranges we need to assign? Network one starts
    with this number and ends with this number, network two starts with this
    number and goes to this number, etc… (Don’t forget the Network Number and
    the Broadcast Number).




Imad Khadduri         Windows 2003                                              6
      Start by drawing the The Octet Table:
      |         |    |      |     |       |    |      |   These are the 8 bits in one octet

      27        26   25    24   23       22   21     20

      128 64        32    16    8     4     2      1
      ---------↓     ↓     ↓   ↓       ↓    ↓     ↓
            192------↓     ↓   ↓       ↓    ↓     ↓
                  224------↓   ↓       ↓    ↓     ↓
                       240-----↓       ↓    ↓     ↓
                             248-------↓    ↓     ↓
                                      252---↓     ↓
                                            254---↓
                                                 255
Start with 1 at the lowest order position, and double up. We thus assign decimal values to the
different bits.
To find out the decimal equivalent, we simply add up all the decimal values of the bits that are
ONE (Not Zero). If they are all ones, as we see above, then we do get:
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. If , for example, only the FOUR left most bits are Ones
and the remaining four are Zeros, then we get 128 + 64 + 32 + 16 = 240.


Imad Khadduri             Windows 2003                                                              7
A typical subnetting example:
The INTERNIC has assigned you a Class B IP:
    132 . 15 .anything.anything
    |||||||| . |||||||| . X . X

Task:
We want to have 1000 hosts on each network segment, and as many network
segements as possible.

Procedure:
What is the subnet mask, in decimal value?
What is the actual number of hosts per network that I will finally get?
What is the total number of networks that I will actually get?
What is the range of addresses that I can assign (excluding Network and
Broadcasting IP addresses)?




Imad Khadduri       Windows 2003                                          8
SOLUTION:
How many bits do I need to get 1000 hosts?

(1) To figure out the number of required bits for 1000 hosts, use this
equation:
  2BITS – 2
NOTE: (this equation, along with the Octet Table, is all you need in
an exam).
Do the shorthand method (no calculator) that uses the above equation. This boils
down to starting with the 1 bit (which gives 0 in decimal – for the two network and
broadcast IPs) , and you DOUBLE the decimal number AND ADD 2:
Bit:            1   2   3    4 5 6 7      8             9      10
Decimal:        0   2   6    14 30 62 126 254           510    1022


Hence, we need to assign 10 bits to get those 1000 hosts !!


Imad Khadduri           Windows 2003                                                  9
Go back to our IP and assign those 10 bits (The TEN 0s for the hosts, and
the remaining available bits – here 6 are left - as 1s for the networks,):

132    . 15 . anything . anything
||||||||.|||||||.||||||00.00000000

Since we have (were assigned) a Class B address, we will therefore only be
able to use six bits for the networks and 10 bits for the hosts.
Remember, this is your own setting up of network segments and number of
hosts as required by your ‘company’, once you are assigned a B class IP.

That will give us 2BITS – 2 hosts = 210-2 = 1024 – 2 = 1022 hosts per network,
and
2BITS – 2 networks = 26 - 2 = 64 – 2 = 62 possible networks.

We have now two answers, number of hosts and networks. Next:

(2) What is the decimal subnet mask that corresponds to this, to define the
network segment?

Imad Khadduri        Windows 2003                                                10
Use the Octet table. We have six bits, in the third octet (octets one and two
are used by the Class B IP assignment itself), for use the network segments:

      The Octet Table:
      |     |      |     |      |     |      |     |
      27    26     25    24     23    22     21    20
      128 64        32     16    8      4     2     1
      ----------↓
            192------↓
                  224------↓
                        240-----↓
                              248-------↓
                                    252-----↓
                                          254--------↓
                                                     255


 132    . 15 .      X                              . X
||||||||.|||||||. ||||||00                         .00000000

 255    . 255 . 252 (Add up all decimal values except for the first two). 0
Therefore, the decimal subnet mask is 255.255.252.0 .

Imad Khadduri                  Windows 2003                                     11
We have now three answers, number of hosts and networks and subnet mask.
Next, the final step:
(3) What range of addresses will we give out?
Important Note: Take note of the decimal value of the last bit that identifies
the network. The decimal value of that last bit, 4 in the case we have at hand
(from the Octet table), is where our address range STARTS, and it is also
how we INCREMENT it to get the rest of the network segments.
Hence, my address range of 1022 IPs that I can assign to hosts in this
network segment :
starts with 132 . 15 . 4 . 1 and goes all the way to 132 . 15 . 7 . 254

(remember, the first IP in this network segment 132.15.4.0 defines the
network segment and the last IP in this network segment 132.15.7.255 is for
Broadcast), and you can then assign the rest of the other 1022 IPs to 1022
hosts in this one network segment.



Imad Khadduri        Windows 2003                                            12
The next network segment will be 132 . 15 . 8 . 1 – 132 . 15 . 11 . 254
(Note we incremented 4 by 4 = 8, and 7 by 4 = 11)

Hence, my address range of 1022 IPs that I can assign to hosts in this
network segment starts with 132 . 15 . 8 . 1 and goes all the way to 132 . 15 .
11. 254

The next network segment is 132 . 15 . 12 . 1 – 132 . 15 . 15 . 254

The next network segment is 132 . 15 . 16 . 1 – 132 . 15 . 19 . 254

………

And so on for the rest of the 62 network segments that are defined by this
subnet mask.




Imad Khadduri         Windows 2003                                                13
Again, it is up to me, as Network Administrator, how to set the subnet mask
for my ‘company’, according to its requirements. I could have used the Class
B IP with its subnet mask (255.255.0.0) to set up just the one big network
segment. How many hosts would there be in this one big network segment?




Answer: There 16 bits for the hosts (octet three and four, as octet one and
two – from the left – are taken by the Class B IP).

Therefore, we can have 216 = 65536 hosts (quite a big company, and lots of
network traffic).

Imad Khadduri        Windows 2003                                             14
Summary of procedure for calculating subnetting:

(1) How many networks do I need?You decide according to company request
    OR
    How many hosts per network? You decide according to company
    request
    How many hosts do I get?      2BITS – 2        (START here)
    How many networks do I get?   2BITS – 2        (OR start here)

(2) What is the decimal subnet mask?          Find it using the OCTET
                                              Table. Convert from binary to
                                              decimal for the last octet using
                                              the Octet Table

(3)What address ranges? Take the last bit you are using for the subnet mask.
                        Its decimal value will be the start of first network
                        segment. Its decimal value will also be the
                        increment for the remaining networks.


Imad Khadduri       Windows 2003                                            15
A final note:
Variable Length Subnet Mask (VLSM) notation.
      Sometimes you will see IPs depicted as: 132.15.4.0/22 which is, in fact,
      the length (in bits) of the subnet mask.

      Hence can now easily calculate the number of hosts that such a subnet
      can support by using the formula

       (32-n)
      2       -2
      Where n is the number after the / character. If there n bits fore the
      network segments, then there has to be 32-n bits for the hosts. And -2
      are the two not allowed addresses for the network and broadcast.

      Thus, the above IP (Class B, 6 bits in third octet assigned for network
      segments) has a subnet mask of 255.255.252.0 (using the Octet Table for
      the 3rd octet) and can support the following number of hosts/network:
      132.15.4.0/22 = (2^(32-n)) - 2 = (2^(10)) - 2 = 1022

Imad Khadduri          Windows 2003                                              16
       Routing

                              ARP     195.165.3.2
                                                    Router
                              198.165.3.1             2
                                                             198.162.5.1
                                             RIP
                192.168.1.1                                             ARP
                                  Router
      ARP                           1        OSPF                                192.168.5.5
            Hub
                                                             ARP
                                     192.168.2.1
                                                                           Hub
  A                           B

                                                     C                           D
  198.162. 1.14       198.162. 1.20
  255.255.255.0       255.255.255.0                  198.162. 2.7    198.162. 2.12
                                                     255.255.255.0   255.255.255.0

       MAC           Media Access Control address
       ARP           Address Resolution Protocol
       RIP           Routing Information Protocol


Imad Khadduri                        Windows 2003                                              17
      OFPS      Open Shortest Path First




Imad Khadduri             Windows 2003     18

								
To top