Você está na página 1de 38

IP Addressing Made Easy

Developed by Capt Vijender Pal Singh 172 Fd Regt

Working with IP Addresses

Introduction
You can probably work with decimal numbers much easier than with the binary numbers needed by the computer. Working with binary numbers is timeconsuming & error-prone.

Peter Smith

Note.
If a Protocol uses N bits to define an address,the address space is 2N,because each bit can have two values (0 and 1) and N bits can have 2N values. So, a 32 bit address can have 232 UNIQUE values .

Octets
The 32-bit IP address is broken up into 4 octets, which are arranged into a dotteddecimal notation scheme. An octet is a set of 8 bits & not a musical instrument. Example of an IP version 4: 172.64.126.52

Peter Smith

Thinking in Binary
The binary system uses only 2 values 0 & 1 to represent numbers in positions representing increasing powers of 2. We all are accustomed to thinking & working in the decimal system, which is based on the number 10.

Peter Smith

Thinking in Binary (Cont.)


To most humans, the number 124 represents 100 + 20 + 4. To the computer, this number is 1111100, which is 64 (26) + 32 (25) + 16 (24) + 8 (23) + 4 (22) + 0 + 0

Peter Smith

Each position in a binary number represents, right to left, a power of two beginning with 20 & increasing by one power as it moves left: 20, 21, 22, 24, etc.

Peter Smith

Converting to Decimal
Youll need to convert binary to decimal & vice versa to compute subnets & hosts. So, its time for a quick review lesson in binary-to-decimal conversion. There are 8 bits in an octet & each bit can only be a 1 or a 0.

Peter Smith

Converting to Decimal (Cont.)


What then do you suppose is the largest decimal number that can be expressed in an octet?

Eight 1s (1111 1111)

Peter Smith

10

Converting to Decimal (Cont.)


Now, for double the money, what is its equivalent decimal value?
27 1 128 26 1 64 25 1 32 24 1 16 23 1 8 22 1 4 21 1 2 20 1 1

The binary number 1111 1111 converts into the decimal number: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255

Peter Smith

11

Converting to Decimal (Cont.)


Therefore, the largest decimal number that can be stored in an IP address octet is 255. The significance of this should become evident later in this presentation.

Peter Smith

12

IP Address Classes
In the class system, the class of the address determines which part belongs to the network address, and which part belongs to the host address IP addresses are divided into 5 classes, each of which is designated with the alphabetic letters A to E. Class D addresses are used for multicasting. Class E addresses are reserved for testing & some mysterious future use.
Peter Smith 13

IP Address Classes (Cont.)


The 5 IP classes are split up based on the value in the 1st octet:

Peter Smith

14

Are You the Host or the Network?


The 32 bits of the IP address are divided into Network & Host portions, with the octets assigned as a part of one or the other.
Network & Host Representation By IP Address Class
Class
Class A Class B Class C

Octet1
Network Network Network

Octet2
Host Network Network

Octet3
Host Host Network

Octet4
Host Host Host

Peter Smith

15

Are You the Host or the Network? (Cont.)


Each Network is assigned a network address & every device or interface (such as a router port) on the network is assigned a host address. There are only 2 specific rules that govern the value of the address.

Peter Smith

17

Are You the Host or the Network? (Cont.)


A host address cannot be designated by all zeros or all ones. These are special addresses that are reserved for special purposes.

Peter Smith

18

IP Addressing : Classes

Identification of IP Address Class


The class of address can be determined easily by examining the first octet of the address and mapping that value to a class range. In an IP address of 172.31.1.2, for example, the first octet is 172. Because 172 falls between 128 and 191, 172.31.1.2 is a Class B address.

Class A Addresses
Class A IP addresses use the 1st 8 bits (1st Octet) to designate the Network address. The 1st bit which is always a 0, is used to indicate the address as a Class A address & the remaining 7 bits are used to designate the Network. The other 3 octets contain the Host address.

Peter Smith

21

IP Addressing : Classes
IP addressing supports five different address classes: A, B,C, D, and E. Only classes A, B, and C are available for commercial use. The left-most (high-order) bits indicate the network class.
32 Bits Range of host addresses 1.0.0.0 to 126.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 240.0.0.0 to 247.255.255.255 0 10 110 1110 11110 Network Network Network Multicast Address Reserved for future use Host Host Host Class A B C D E

Class A Addresses (Cont.)


There are 128 Class A Network Addresses, but because addresses with all zeros arent used & address 127 is a special purpose address, 126 Class A Networks are available.

Peter Smith

23

Class A Addresses (Cont.)


There are 16,777,214 Host addresses available in a Class A address. Rather than remembering this number exactly, you can use the following formula to compute the number of hosts available in any of the class addresses, where n represents the number of bits in the host portion: (2n 2) = Number of available hosts

Peter Smith

24

Where is 127.0.0.0-127.255.255.255?
Address, 127.0.0.1, is the loopback address, and refers to your machine. Whenever you see, 127.0.0.1, you are actually referring to your own machine. That means if you clicked on this link, http://127.0.0.1, you are actually trying to connect to your own computer, and unless you have a web server running, you will get a connection error. you should always be able to ping 127.0.0.1, irrespective of connectivity to the network, as it represents your own machine.

Class A Addresses (Cont.)


For a Class A network, there are: 224 2 or 16,777,214 hosts. Half of all IP addresses are Class A addresses. You can use the same formula to determine the number of Networks in an address class. Eg., a Class A address uses 7 bits to designate the network, so (27 2) = 126 or there can be 126 Class A Networks. This type of allocation is generally given to very large networks such as multi-national companies
Peter Smith 26

IP Addressing : Classes
IP addressing supports five different address classes: A, B,C, D, and E. Only classes A, B, and C are available for commercial use. The left-most (high-order) bits indicate the network class.
32 Bits Range of host addresses 1.0.0.0 to 126.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 240.0.0.0 to 247.255.255.255 0 10 110 1110 11110 Network Network Network Multicast Address Reserved for future use Host Host Host Class A B C D E

Class B IP Addresses
Class B addresses use the 1st 16 bits (two octets) for the Network address. The last 2 octets are used for the Host address. The 1st 2 bit, which are always 10, designate the address as a Class B address & 14 bits are used to designate the Network. This leaves 16 bits (two octets) to designate the Hosts.

Peter Smith

28

Class B IP Addresses (Cont.)


So how many Class B Networks can there be? Using our formula, (214 2), there can be 16,382 Class B Networks & each Network can have (216 2) Hosts, or 65,534 Hosts. These blocks are generally allocated to Internet Service Providers and large networks, like a college or major hospital.

Peter Smith

29

IP Addressing : Classes
IP addressing supports five different address classes: A, B,C, D, and E. Only classes A, B, and C are available for commercial use. The left-most (high-order) bits indicate the network class.
32 Bits Range of host addresses 1.0.0.0 to 126.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 240.0.0.0 to 247.255.255.255 0 10 110 1110 11110 Network Network Network Multicast Address Reserved for future use Host Host Host Class A B C D E

Class C IP Addresses
Class C addresses use the 1st 24 bits (three octets) for the Network address & only the last octet for Host addresses.the 1st 3 bits of all class C addresses are set to 110, leaving 21 bits for the Network address, which means there can be 2,097,150 (221 2) Class C Networks, but only 254 (28 2) Hosts per Network. This type of class is generally given to small to mid-sized companies.
Peter Smith 31

IP Addressing : Classes
IP addressing supports five different address classes: A, B,C, D, and E. Only classes A, B, and C are available for commercial use. The left-most (high-order) bits indicate the network class.
32 Bits Range of host addresses 1.0.0.0 to 126.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 240.0.0.0 to 247.255.255.255 0 10 110 1110 11110 Network Network Network Multicast Address Reserved for future use Host Host Host Class A B C D E

IP Addressing : Classes

Identification of IP Address Class


The class of address can be determined easily by examining the first octet of the address and mapping that value to a class range. In an IP address of 172.31.1.2, for example, the first octet is 172. Because 172 falls between 128 and 191, 172.31.1.2 is a Class B address.

Special IP Addresses
Specific Notations
IP address 0.0.0.0 used by hosts when they boot and not used afterwards. IP address with 0 as n/w no refer to the current n/w. Allow machines to refer to own n/w IP address with all 1s is a Broadcast address IP address with n/w no and all 1s in host address is broadcast for a distant LAN. IP address 127.xx.yy.zz used for debuging n/w software. Pkts not sent on to the n/w but looped internally.

00000000000000000000000000000000
00 . 00
Host

This Host A Host on This Network Broadcast on Local Network Broadcast on a Distant Network Loop Back

11111111111111111111111111111111 Network 127 1111 .. 1111

(Anything)

Special Addresses (Cont.)

Peter Smith

36

Special Addresses (Cont.)


A list of these addresses for each IP address class:

Peter Smith

37

Você também pode gostar