Top Banner

Click here to load reader

IP Addressing

Nov 18, 2014

ReportDownload

Documents

paul

IP Addressing tcp/ip

ip addressesConverting binary to decimal Consider the octet 11111101. If you are familiar with counting in binary you will know that this number is 253. 2^7 128 1 2^6 64 1 2^5 32 1 2^4 16 1 2^3 8 1 2^2 4 1 2^1 2 0 2^0 1 1

128+ 64 + 32 + 16 + 8 + 4 + 0 + 1 = 253 There is an easier way to convert this number to decimal. We know that the binary number 11111111 is 255 in decimal. When we look at a number like 11111101, here subtract 2 from 255 to arrive at our decimal conversion 253. For 11101101 128+64+32+0+8+4+0+1=237 or 255- 2 -16 = 255 18 = 237 if you want to get good at subnetting memorize 10000000 = 128 11000000 = 192 11100000 = 224 11110000 = 240 11111000 = 248 11111100 = 252 11111110 = 254 11111111 = 255

Private Address SpaceThe Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of IP address space for private networks You can use addresses on any private LAN You CANNOT use them on the internet, internet routers will block them!

Private IP addresses range

Which of the following are true about 172.16.0.254/16?

A. IPX:MAC addresses. B. IP:classC directed broadcast. C. Private IP address:node number D. Public IP addresses:directed broadcast. E. Private IP addresses directed broadcast. Answer C Explanation The Class B network of 172.16 is a Class B Private Address Range, and the second part (0.254) is the host address, or node number/address. Incorrect Answers A. The address is an IP address format. B. The question is a Class B address, if it were Class C, the mask would be 255.255.255.0 D. 172.16 is not a public IP address. E. 0.254 is not a broadcast address Question Which of the following describe private IP addresses? (Choose two) A. Addresses chosen by a company to communicate with the Internet. B. Addresses that cannot be routed through the public Internet. C. Addresses that can be routed through the public Internet. D. A scheme to conserve public addresses. E. Addresses licensed to enterprise or ISPs by an Internet registry organization. Answer B, D Explanation Private IP address space has been allocated via RFC 1918. This means the addresses are available for any use by anyone and therefore the same private IP addresses can be reused. However they are defined as not routable on the public Internet. They are used extensively in private networks due to the shortage of publicly registered IP address space and therefore network address translation is required to connect those networks to the Internet.

IP Addressing ClassesThe IP address range has 5 different classes A to E,

Class A address range 0 - 126 Class B address range 128 - 191 Class C address range 192 - 223 Class D address range 224 - 239

Class AClass A has a 7-bit network number and a 24-bit local address. The highest order bit is always set to zero. This allows 128 (2^7) class A networks.

This shows the eight network bits followed by the 24 host bits.

Class BClass B network addresses have a 14-bit network number, a 16-bit local address, and they begin with "10" binary. This allows 16,384 class B networks. The first two bits of a Class B address are 1 and 0, the next fourteen bits identify the network and the last sixteen the host.

128.0.0.0 to 191.254.0.0 We can divide the host portion of a Class B address into subnet and host parts. For instance, let's split our Class B network number on the byte boundary, the eight of the host portion identifies the subnet and the remaining bits the host, as diagramed: Network Subnet Host +--------------+ +------+ +------+ | | | | | | [10xxxxxxxxxxxxxx][xxxxxxxx][xxxxxxxx] This arrangement allows 254 subnets each with 254 hosts.

Class CClass C network addresses have a 21-bit network number, an 8-bit local address, and they begin with "110" binary. This allows 2,097,152 class B networks.

192.0.1.0 to 223.255.254.0

Class DClass D network addresses are for multicasting

class D addresses 224.0.0.0 to 239.255.255.255 multicast group

Class EClass E network addresses being with 4 binary ones, and this is not allowed. The one exception to this rule is the address where all the bits are ones (255.255.255.255); this is reserved for an IP broadcast.class E addresses 240.0.0.0 to 255.255.255.254 reserved (illegal) 255.255.255.255 reserved (broadcast)

Question IP addresses use hierarchical numbering. What portion of the address that will identify the network number? A. Subnet Mask. B. Dots between octets.

C. Class of first octet. D. Assignments of DHCP. E. Address Resolution Protocol. Answer C Explanation In general, IP addresses contain two fields: one for the network and another for host. Class A addresses have a range of 1 to 126 and the network portion of the IP address is restricted to the first eight bits (octet). Class B address have a range of 128 -191. and the network portion of the IP address is contain in the first 2 octets. Class C IP addresses has a range of 192- 223 and the network portion of the IP addresses is the first three octets of the IP address. Class D addresses include the range of 224.0.0.0 to 239.255.255.255 and are used for multicast address. Class E addresses have a range of 224.0.0.0 to 247.255.255.255 and are reserved for experimental purposes. Incorrect Answers A. Although the subnet mask is used network devices to determine what part of the IP use address for the network, the subnet and the host address but it is not part of the IP address hierarchy. B. The dots are used for making the IP address readable by humans, but have no determination of the network number. D. DHCP (Dynamic Host Configuration Protocol) provides a mechanism for allocating IP addresses dynamically so that addresses can be reused when hosts no longer need them. E. Address Resolution Protocol (ARP) determines the data link layer address of the destination devices for known destination IP addresses network number.

The Subnet MaskA subnet mask is used to determine the number of bits used for the subnet and host portions of the address. The mask is a 32-bit value that uses one-bits for the network and subnet portions and zero-bits for the host portion.

Configuring Subnet MasksIf you have one address and want to create six networks from it heres where subnetting comes in benefits are Reduced network traffic- with routers, most traffic stays on the local network only packets destined for other networks pass through the router. Routers create broadcast domains the smaller the broadcast domains the less network traffic.

Understanding Classless Inter-Domain Routing (CIDR) also known as supernettingThis really is a more efficient way of referring to a network. For example, if we had a network address of 192.168.0.0 with a mask of 255.255.255.128, in CIDR notation it becomes 192.168.0.0/25. The /25 means that the first 25 bits of the subnet mask are set to binary 1

192.168.10.32/8 this tells you what your subnet mask is the slash tells us how many bits are 1s. Class A default subnet mask 255.0.0.0 this means the 1st byte of the subnet mask is all 1s or 11111111 which is /8 Net bits Subnet mask /20 /21 /22 255.255.240.0 255.255.248.0 255.255.252.0 total-addresses 4096 2048 1024

/23 /24 /25 /26 /27 /28 /29 /30

255.255.254.0 255.255.255.0

512 256

255.255.255.128 128 255.255.255.192 64 255.255.255.224 32 255.255.255.240 16 255.255.255.248 8 255.255.255.252 4

The first address of a subnet block (all 0s) is called the network address or network ID. The last address (all 1s) is the broadcast address of the network. Typically the network address +1 or the broadcast address -1 is the gateway to the internet. Example 192.168.1.0/25 would include all address between 192.168.1.0 and 192.168.1.127 while 192.168.1.128/25 would include 192.168.1.128 and 192.168.1.255 Below is a mask table that makes it easy to look up the mask for a group of IP addresses. /25 = 255.255.255.128, Block size 256 - 128 =128 Address range for 192.168.1.0 = 0 127 Address range for 192.168.1.128 = 128 255 We stop when we reach the final address of 255 remember these addresses include the subnet and broadcast address.

Etc..

Let's take a look at two hosts on a Class B network trying to communicate with one another. Assume the IP address of the source host is 172.16.32.1/16 and the destination host address is 172.16.64.1/16. Because we are using the default subnet mask of /16 or 255.255.0.0, 172.16.32.1/16 and 172.16.64.1/16 are on the same network. As long as there is no change in

the network portion of the address, the two hosts are on the same network. The network portion of the address is determined by the subnet mask of 255.255.0.0, which tells the TCP/IP stack that the first two octets, 172.16.0.0, represent the network portion of the address.

SubnettingHowever, if we need more than one network, because we have remote locations or we have more hosts than we can place on a single cable? It makes sense to divide the network into smaller networks. What if we needed to create 6 subnets from our larger, single network? In a case like this, we would need to extend the default subnet mask by borrowing some of the bits from the host portion of the IP address.

The formula for determining the number of subnets = 2^n - 2 (See * )n represents the number of bits to borrow For six useable subnets 2 - 2 = 8 - 2 =

6

To create six subnets from the 172.16.0.0/16 network we need to borrow at least 3 host bits and add them to the network portion giving us 172.16.0.0/19 In binary, the subnet mask would be 11111111.11111111.11100000.00000000 So, our subnet mask is 255.255.224.0. * In the case of a custom subnet mask of 224, we create at least 6 networks. (I say at least because the actual number depends on the hardware or the software). It should be noted that in the past using subn