Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Real Networkers don’t use Decimal! Part 1. Binary & Interpreting IP Addresses October 19, 2004.

Similar presentations


Presentation on theme: "1 Real Networkers don’t use Decimal! Part 1. Binary & Interpreting IP Addresses October 19, 2004."— Presentation transcript:

1 1 Real Networkers don’t use Decimal! Part 1. Binary & Interpreting IP Addresses October 19, 2004

2 2 Understanding Binary Computers, networks and network addressing schemes use the binary number system. Number systems are based on “powers of” the base number. Binary is based on powers of 2. The powers of 2 table is a powerful tool for network designers.

3 3 Counting in Binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111

4 4 Powers of 2 powerdecimalbinary 01 1 12 10 24 100 38 1000 416 10000 532 100000 664 1000000 7128 10000000 8256 100000000 9512 1000000000 101,024 10000000000 112,048 100000000000 124,096 1000000000000 138,192 10000000000000 1416,384 100000000000000 1532,768 1000000000000000 1665,536 10000000000000000 2 POWER Example 2 3 = 8 decimal = 1000 binary Notice 3 zeros.

5 5 Powers of 2, continued powerdecimalbinary 17131,072100000000000000000 18262,1441000000000000000000 19524,28810000000000000000000 201,048,576100000000000000000000 212,097,1521000000000000000000000 224,194,30410000000000000000000000 238,388,608100000000000000000000000 2416,777,2161000000000000000000000000 2533,554,43210000000000000000000000000 2667,108,864100000000000000000000000000 27134,217,7281000000000000000000000000000 28268,435,45610000000000000000000000000000 29536,870,912100000000000000000000000000000 301,073,741,8241000000000000000000000000000000 312,147,483,64810000000000000000000000000000000 324,294,967,296100000000000000000000000000000000 32 0’s

6 6 Conversion from Binary to Decimal Decimal value is determined by the total value of bits. Each bit position value is some power of 2

7 7 Conversion sample 1 1101101101 Add the value of each bit position containing a one. = 512 + 256 + 64 + 32 + 8 + 4 + 1 = 877

8 8 Conversion sample 2 11011011011101101101 Add the value of each bit position containing a one. = 524288 + 262144 + 65536 + 32768 + 8192 + 4096 + 1024 + 512 + 256 + 64 + 32 + 8 + 4 + 1 = 898,925

9 9 Key Points of IP addressing 32 bits addressing allows 4,294,967,295 possible addresses. Not feasible to keep track of 4.3 trillion routes to individual hosts. Separating the address into Network Bits and Host bits allows a single network address to summarize information for many hosts. 00101100011110111010110001111011 Network Bits Host bits

10 10 Identifying networks A network address represents a way to connect to many hosts. One Class A network address connects 16,777,215 hosts One Class C network connects 255 hosts. Network addresses are identified by setting the host bits to 0 in an IP Address. 11011110 00100001 00000100 00000000 is a Class C network 11011110 00100001 00000100 00100100 is a host on that network

11 11 Three types of IP addresses Network Address:Host bits all 0 ’s Broadcast Address:Host bits all 1 ’s Host Address:at least one 0 & one 1 11011110 00100001 00000100 00000000 is a network address. 11011110 00100001 00000100 11111111 is the broadcast address for that network. 11011110 00100001 00000100 00100100 is a host address on that network. All 0’s All 1’s

12 12 Address Ranges 32 bits on every device 10101100 01111011 10101100 01111011 Class A: 8 network bits, 24 host bits, starts 0… 00101100 01111011 10101100 01111011 Class B: 16 network bits, 16 host bits, starts 10… 10101100 01111011 10101100 01111011 Class C: 24 network bits, 8 host bits, starts 110… 11001100 01111011 10101100 01111011 Does this address identify a host or a network?

13 13 Address Ranges Class D: Multicast, starts 1110… 11100110 01111011 10101100 01111011 224.0.0.5 and 224.0.0.6 are used by OSPF Class E: Reserved, starts 1111… 11110100 01111011 10101100 01111011 Classes D & E are not important in CCNA1.

14 14 Address Ranges in Decimal Class A1.0.0.0 - 126.0.0.0 (127 is local loopback) Class B128.0.0.0 - 191.255.0.0 Class C192.0.0.0 - 223.255.255.0 Class D224.0.0.0 - 239.255.255.255 Class E240.0.0.0 - 247.255.255.255

15 15 Special Address Ranges Private Class A 10.0.0.0 - 10.255.255.255 Private Class B 172.16.0.0 - 172.31.255.255 Private Class C 192.168.0.0 - 192.168.255.255 Local Loopback 127.0.0.0 - 127.255.255.255 Automatic Private IP Addressing 169.254.0.0 - 169.254.255.255

16 16 Notation Scheme IP: 32 bit binary number for all addresses. 10101100011110111010110001111011 Reading and writing 32 bits of binary is too hard! Converting all 32 bits to Decimal is too tedious Break 32 bits into 4 groups of 8 bits called octets Dotted Decimal notation converts octets to decimal A notation scheme is merely a way of representing the bits in an address, it is for convenience – networking is based on the bits not the notation!

17 17 Sample Address in bits Without breaking it down into octets 10101100011110110010110001111000 = 2,893,753,464 too hard to do correctly

18 18 Sample Address, dotted decimal Same address using octets 10101100.01111011.00101100.01111000 easy to add up each octet 128 + 32 + 8 +4 ● 64 + 32 + 16 + 8 + 2 + 1 ● 32 + 8 + 4 ● 64 + 32 +16 +8 = 172.123.44.120 in dotted decimal notation

19 19 Sample Address Network & Host Bits Begins 10… so it is a Class B address with the first 16 bits representing the network. 10101100.01111011.00101100.01111000 172.123.44.120 in dotted decimal. This is the 00101100.01111000 host on the 10101100.01111011 network.

20 20 Subnetting begins! In A, B, & C networks, boundary between network and host bits always on an octet boundary. 10101100.01111011.00101100.01111000 Subnetting: some host bits are converted to subnet bits. 10101100.01111011. 001 01100.01111000 172.123.44.120 One octet may have both subnet & host bits.

21 21 How many subnets? 10101100 01111011 001 00000 00000000 has three subnet bits. Represents just one subnet. When 3 bits are used for subnetting, how many possible subnets may be created? Lets list them. Subnet #BitsSubnet #Bits 0 000 4 100 1 001 5 101 2 010 6 110 3 011 7 111 8 subnets Notice that when the bits are converted from binary to decimal, you get the subnet number!

22 22 Possible subnets in Binary 3 bits are borrowed in a Class B network SN# 0: 10101100 01111011 000 00000 00000000 SN# 1: 10101100 01111011 001 00000 00000000 SN# 2: 10101100 01111011 010 00000 00000000 SN# 3: 10101100 01111011 011 00000 00000000 SN# 4: 10101100 01111011 100 00000 00000000 SN# 5: 10101100 01111011 101 00000 00000000 SN# 6: 10101100 01111011 110 00000 00000000 SN# 7: 10101100 01111011 111 00000 00000000 Subnet number is decimal of subnet bits

23 23 Possible subnets in Dotted Decimal 3 bits are borrowed from a class B network SN# 0: 172.123.0.0 SN# 1: 172.123.32.0 SN# 2: 172.123.64.0 SN# 3: 172.123.96.0 SN# 4: 172.123.128.0 SN# 5: 172.123.160.0 SN# 6: 172.123.192.0 SN# 7: 172.123.224.0

24 24 Some Addresses on a Subnet 10101100 01111011 00100000 00000001 (172.123.32.1) and 10101100 01111011 00100010 00000000 (172.123.34.0) are both hosts on the 10101100 01111011 00100000 00000000 (172.123.32.0 ) network. What address type is 10101100 01111011 01100010 00000000 (172.123.98.0) ?

25 25 The Formula! 3 bits can provide for 8 possible subnets, 4 bits can provide for 16 possible subnets. What is the rule? # of Possible Subnets = 2 Number of subnet bits The Powers of 2 table again!

26 26 Why a mask is necessary A 32 bit address may be interpreted many ways. 10101100 01111011 00101100 01111000 172.123.44.120/16 (no subnet) 10101100 01111011 00101100 01111000 172.123.44.120/19 (subnetted using 3 bits) 10101100 01111011 00101100 01111000 172.123.44.120/21 (subnetted using 5 bits) IP address is meaningless without a mask!

27 27 Masking Subnet mask: every network bit is 1 and every host bit is 0. Binary Address: 10101100.01111011.00101100.01111000 Binary Mask: 11111111.11111111.00000000.00000000 Dotted Decimal Address: 172.123.44.120 Dotted Decimal Mask: 255.255.0.0 This is the default mask of a class B network.

28 28 Masking a 3 bit Subnet Network, Subnet, & Host Bits Binary Address: 10101100 01111011 00101100 01111000 Binary Mask: 11111111.11111111.11100000.00000000 Prefix: 11111111.11111111.111 count 1’s 19 Dotted Decimal Address: 172.123.44.120 Dotted Decimal Mask: 255.255.224.0 Prefix: /19 The mask does not distinguish between network and subnetwork bits!

29 29 Masking a 4 bit Subnet Network, Subnet, & Host Bits Binary Address: 10101100 01111011 00101100 01111000 Binary Mask: 11111111.11111111.11110000.00000000 Dotted Decimal Address: 172.123.44.120 Dotted Decimal Mask: 255.255.240.0 Prefix: /_ _ Only 9 possible mask values: 0, 128, 192, 224, 240, 248, 252, 254 and 255

30 30 How many subnet bits? A mask has only network and host bits. The number of subnet bits must be calculated. Number of subnet bits = Number of actual mask network bits – Number of default (class) mask network bits

31 31 Example Subnet bits calculation. Address: 172.123.44.120 10101100 01111011 00101100 01111000 Mask: 255.255.240.0 or /20 11111111.11111111.11110000.00000000 Address begins 10… so it is a Class B address which has a /16 default mask. 20 mask bits – 16 default mask bits = 4 subnet bits

32 32 How a Mask works. The IP address and the mask are ANDed to determine the network address. 0 AND 0 = 0 0 AND 1 = 0 1 AND 0 = 0 1 AND 1 = 1 The mask acts as a filter which keeps only the network bits, sets all others to 0.

33 33 Sample Mask Application What is the network address of Address: 172.123.44.120 10101100 01111011 00101100 01111000 Mask: 255.255.240.0 or /20 11111111.11111111.11110000.00000000 Apply the mask: 10101100 01111011 00101100 01111000 11111111.11111111.11110000.00000000 10101100 01111011 00100000 00000000 Network Address: 172.123.32.0 AND Applying a Mask to an IP address leaves the network address!

34 34 Determining the Broadcast Address for a network Start with a network address and mask 10101100 01111011 00100000 00000000 (172.123.32.0) 11111111.11111111.11110000.00000000 (255.255.240.0) Apply the mask; network bits remain unchanged! 10101100 01111011 0010 Set all host bits to 1’s 1111 11111111 Put them together and you have the broadcast address 10101100 01111011 0010 1111 11111111 172.23.47.255 is the broadcast address for the 172.123.32.0 /20 network The mask is necessary!

35 35 Interpreting IP Addresses To get the network address from a specific host address and mask. 1. Convert Address and Mask to binary 2. AND the Address and Mask to get the Network Address 3. Convert the Network Address to decimal

36 36 Determining a Broadcast address To get the broadcast address from a specific network address and mask. 1. Convert Network Address and Mask to binary 2. Use the Mask to identify the network and host bits 3. Copy the network bits from the Network Address and make the remaining host bits all 1’s. 4. Convert to dotted decimal.

37 37 HAPPY NETWORKING!


Download ppt "1 Real Networkers don’t use Decimal! Part 1. Binary & Interpreting IP Addresses October 19, 2004."

Similar presentations


Ads by Google