IP Addressing
IP Addressing
IP Addressing
Layer 3 Responsibilities
Move data through a set of networks. Use a hierarchical addressing scheme. Segment network and control flow of traffic. Talk to other networks with services offered by ISPs (Internet Service Providers).
Layer 3 Devices
Routers
Interconnect network segments or entire networks. Make logical decisions based on IP addresses. Determines best path for data on an internetwork.
Path Determination
The process the router uses to choose the next hop in the path the packet travels. The router uses the network address to identify the destination network of a packet within an internetwork. IP addresses can be assigned by a network administrator or automatically (dynamically.)
Layer 3 Packet/Datagram
VERS HLEN Service Type Total Length
Identification
Time to Live Protocol
Flags
Fragment Offset
Header Checksum
233.14.17.0
The IP address has two components:
The Network ID
The Host Id
IP Addressing
IP Addresses can be notated in Dotted Decimal and/or Binary, but you must understand both Dotted Decimal is what we are familiar with
eg. 128.41.230.65 To find out what the value of the dotted decimal octet is we must know what the binary format is
1 indicates that the binary place is on 0 indicates that the binary place is off
IP Addressing
Add up the number of locations contained by the dots : xxx.xxx.xxx.xxx = 4 octets Each octet contains 8 binary bits that tell us what the value of the octet in the dotted decimal notation
XXX.XXX.XXX.XXX
Each octet is made up of 8 binary bit places Calculate 4 octets X 8 bits = 32 bits total
=255
=0 =1 =3 = 67 =128
128.41.230.65
128
1 0 0 0 0 0 0 0
! Remember the value of the first binary bit place is 128 and the first bit place is turned on !
128.41.230.65
41
0 0 1 0 1 0 0 1
! Remember the values of the bit places turned on 32, 8, and 1 32+8+1=41 !
128.41.230.65
230
1 1 1 0 0 1 1 0
! Remember the values of the bit places turned on 128, 64, 32, 4, and 2 128+64+32+4+2=230 !
128.41.230.65
65
0 1 0 0 0 0 0 1
! Remember the values of the bit places turned on 64, and 1 64+1=65 !
128.41.230.65
128.41.230.65
The whole thing in binary would look like this
10000000.00101001.11100110.01000001
Layer 3 Addresses
Network ID
Host ID
Assigned by ARIN (www.arin.net) Identifies the network to which a device is attached. May be identified by one, two, or three of the first three octets.
Assigned by a network administrator. Identifies the specific device on that network. May be identified by one, two, or three of the last three octets.
IP Addresses
32 bit address represented as 8 bit dotted decimals. Different class addresses reserve different amounts of bits for the Network and Host portions of the address.
Class A
Class B
Class C
N
N
N
N
H
N
H
H
Number of Hosts
Class A has 16,777,214 available hosts (224 2) Class B has 65,534 available hosts (216 2) Class C has 254 available hosts (28 2)
The first address in each network is reserved for the network address and the last address is reserved for the broadcast address.
Classes
How do you know what class an IP address is in? If the first octet is between:
0 127 it is a class A address 128-191 it is a class B address 192 223 it is a class C address
Class C
Reserved Addresses
Network Address (wire address) This is an IP address that ends with binary 0s in all host bits. Class A Network Address example:
113.0.0.0
Hosts on a network can only communicate directly with other hosts if they have the same network ID. If they dont, they will not be able to communicate unless there is another device connecting the networks.
Reserved Addresses
Broadcast Address is used to send data to all of the devices on a network. Broadcast IP addresses end with binary 1s in the host part of the address. Class B Broadcast Address example:
176.10.255.255
Special Addresses
A few addresses are set aside for specific purposes. Network addresses that are all binary zeros, all binary ones & Network addresses beginning with 127 are special Network addresses.
Special Addresses
(Cont.)
Special Addresses
(Cont.)
Within each address class is a set of addresses that are set aside for use in local networks sitting behind a firewall or NAT (Network Address Translation) device or Networks not connected to the Internet.
Special Addresses
(Cont.)
Basics of Subnetting
Subnetworks are smaller divisions of networks. They provide addressing flexibility. A.K.A. subnets Subnet addresses are assigned locally, usually by a network administrator. Subnets reduce a broadcast domain.
Subnet Addresses
Include Class A, B, or C network portion plus a subnet field and a host field. Bits are borrowed from the host field and are designated as the subnet field.
Network
Subnet
Host
Class B
Class C
16
8
14
6
Class C Subnets
Network Network Network Host
Two Bits Borrowed from the Host Field to form a third layer of hierarchy - A Subnet Field Two Bits must always remain so a maximum of 6 Bits may be borrowed from a Class C network How many bits can be borrowed from a Class B network? From a Class A network?
Class C Subnets
Network Network Network Host
Class C Subnets
S S H H H H H H
Class C Subnets
S S S S S H H H
#Subnets
4 8 16 32 64 128 256 512 1,024 2,048 4,096 8,192 16,384 32,768 65,536 131,072 262,144 524,288 1,048,576 2,097,152
Available Subnets
2 6 14 30 62 126 254 510 1,022 2,046 4,094 8,190 16,382 32,766 65,534 131,070 262,142 524,286 ######## ########
# Hosts = 26 = 64 hosts/subnet?
If there are 6 Host Bits remaining you do NOT get 64 Hosts/Subnet. Why? Each subnet has its own Subnet Address and Broadcast Address - Both of these addresses are Reserved and cannot be used! Thus only 62 Hosts are available.
Available Hosts
62 30 14 6 2 510 254 126 62 30 14 6 2
Formulas to Remember!
# Subnets Created = 2# Borrowed Bits-2
Remember to subtract 2 for the Subnetwork Address and Subnetwork Broadcast Address.
177.56.45.13
What class is this address? Class B What is the default subnet mask? 255.255.0.0 Borrow 2 bits for the subnet mask
NNNNNNNN.NNNNNNNN.SShhhhhh.hhhhhhhh
Calculating a Subnet
223.14.17.0 Class C
Step #1
255.255.255.0
Step #2
Determine the number of subnets needed and hosts on each to determine how many bits to borrow from the host ID. Need:
Step #3
Figure the actual number of subnets and hosts by borrowing bits from host ID. Lets see how many subnets and hosts we will have by borrowing 4 bits from the host.
Step #3 continued
223.14.17.0
XXXX
HHHH
16 possible subnets
Step #3 continued
We get 16 possible subnets and 16 possible hosts for each subnet because:
For the 4 bits borrowed each bit can be a 1 or a 0 leaving you with 24 or 16 possible combinations. The same goes for the 4 leftover host bits.
Important: There are only 14 available subnets and hosts on each subnet. Why?
Step #3 continued
Because you cannot use the first and last subnet. Because you cannot use the first and last address within each subnet. For each, one is the broadcast address and one is the network address.
Step #4
XXXX
HHHH
Step #4 continued
Add the place values of X together to get the last octet decimal value of the subnet mask.
128 + 64 + 32 + 16 = 240
The subnet mask is: 255.255.255.240 The subnet mask is used to reveal the subnet and host address fields in IP addresses.
Step 5
Step 5 continued
Subnet # 1 2 3 4 5 6 7 8 Subnet Bits Host Bits In Decimal 0000 0000-1111 .0 -.15 0001 0000-1111 .16 - .31 0010 0000-1111 .32 - .47 0011 0000-1111 .48 - .63 0100 0000-1111 .64 - .79 0101 0000-1111 .80 - .95 0110 0000-1111 .96 - .111 0111 0000-1111 .112 - .127
Step 5 continued
Subnet # 9 10 11 12 13 14 15 16 Subnet Bits Host Bits In Decimal 1000 0000-1111 .128 -.143 1001 0000-1111 .144 - .159 1010 0000-1111 .160 - .175 1011 0000-1111 .176 - .191 1100 0000-1111 .192 - .207 1101 0000-1111 .208 - .223 1110 0000-1111 .224 - .239 1111 0000-1111 .240 - .255
Step 5 continued
There are 16 possible subnets. There are 16 possible hosts on each subnet. That equals 256 possible hosts. What are our available subnets? What are our available hosts on each subnet? Why?????
172.16.2.120
255.255.255.0
10101100.00010000.00000010.01111000
AND 11111111.11111111.11111111.00000000
10101100.00010000.00000010.00000000
172.16.2.0 This is the subnet network address. It is the lowest numbered address on the subnet network. It can help determine path.
Subnetting a Class B
Your Class B network is 146.98.0.0 You have been told to subnet this into at least 40 subnets and at least 600 hosts each How can you decide if this is possible? First, calculate the number of bits you must borrow using 2n-2 Second, calculate the number of hosts possible with the remaining bits using 2n-2
Solution in Binary
Borrow 6 bits (26-2) results in 62 subnets Remaining 10 host bits (210-2) results in 1022 possible hosts Subnet Mask is 11111111.11111111.11111100.00000000 Always note the value of the last bit - in this case it is 4
Determine Usability
Is 146.98.5.255 255.255.252.0 a usable host IP address? Yes. 10010010.01100010.00000101.11111111 11111111.11111111.11111100.00000000 Are all the host bits one? No, so it is not a broadcast address. It is usable
10010010.01100010.00000100.00000000 10010010.01100010.00000111.11111111