IPV4 ADDRESSING − THE BASICS
IT: Network: Cisco 1 Fall 2013
Internet Protocol (IP) from last time ¨
Exists to route ¤ Are
source and destination nodes on same network?
¨
Defines Packet & Header that is transferred
¨
Defines IP address (32 bit number) ¤ Dotted
Decimal (172.17.13.57) ¤ Used to both identify network and host on network
IP Addressing – Binary ¨
Base-10 (Decimal) Power of 10 104 10,000
Value
¨
103
102
101
100
1,000
100
10
1
Base-2 ¤ Only
two “tokens” – 0 and 1 ¤ Places are powers of 2 Power of 2
27
26
25
24
23
22
21
20
Value
128 64
32
16
8
4
2
1
IP Addressing – Binary Sequence Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
Binary 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
IP Addressing Structure Convert Binary to Decimal ¨
What is 1010 1100 in decimal? Write out the powers of 2 (from Right to Left) Power 27
26 25 24 23 22 21 20
Value 128 64 32 16 8
4
2
1
Write the bits of the given Binary number under the correct place values Power
27
26 25 24 23 22 21 20
Value 128 64 32 16 8
1
0 1
4
2
1
0 1 1 0 0
Add up the “Values” where the given binary number has a 1
128 + 32 + 8 + 4 = 172 ¨
1010 1100 = 172
IP Addressing Structure Convert decimal to Binary ¨
What is 172 in binary? Look at place values for Binary numbers: 172 −128
172 >= 128 è 1 in 128’s place
44
− 32
44 < 64 à 0 in 64’s place 44 >= 32 è 1 in 32’s place
12
− 8
¨
172 = 1 0 1 0 1 1 0 0
12 >=8 è 1 in 8’s place
4
-‐ 4
12 < 16 à 0 in 16’s place
4 => 4 è 1 in 4’s place
0
0 <= 2 à
0 in 2’s place
0 <= 1 à 0 in 1’s place
IP Addressing Structure ¨
Practice converting decimal to 8-bit binary
Convert whole IP address to Binary ¨
Just do each octet on its own! – ¤ Fill
¨
out Octet with leading 0's.
172 ¤ 1010
¨
17
.
13
.
57
1100 . 0001 0001 . 0000 1101 . 0011 1001
172 ¤ 1010
.
.
17
.
11
.
16
1100 . 0001 0001 . 0000 1011 . 0001 0000
Easier way ¨
Microsoft Calculator ¤ Start
¨
– All Programs – Accessories – Calculator
Under View menu, choose Scientific (XP) or Programmer (Win7)
Basic IP Addressing Review ¨
32-bit address ¤ Represented
as four 8-bit numbers (“octets”) separated by periods (“dotted decimal”) ¤ 8-bits gives decimal values 0 – 255 for each octet ¤ e.g. 192.168.163.24
Part of address (192.168.163) is network ID ¨ Rest of address (24) is host ID on that network ¨
¨
If two addresses have same network portion, we can do local delivery
Special IP addresses ¨
Host portion all 0’s ¤ ¤ ¤
¨
Host portion all 1’s ¤ ¤ ¤
¨
Network ID or “name of network” 172.17.13.0 Can’t be assigned to any interface!
Network or Directed broadcast 172.17.13.255 Can’t be assigned to any interface!
All bits are 1’s ¤ ¤ ¤
Limited broadcast – Routers don’t forward this 255.255.255.255 Can’t be assigned to any interface!
Subnet mask ¨
This is another 32-bit number
¨
Need to think in binary to really see what this does.
¨
¨
¨
“If a bit in subnet mask is a 1, corresponding bit in the IP address is part of network ID” “If a bit in subnet mask is a 0, corresponding bit in the IP address is part of host ID” All binary '1's will be grouped at start (left) of subnet mask
Full-Octet masking ¨
Look at subnet mask = 255.255.255.0 ¤
¨
Entire first three octets in IP address are Network ID ¤
¨
255 . 255 . 255 . 0 = 11111111.11111111.11111111.00000000
Entire last octet is the host ID
192.168.163.24 sends to 192.168.163.145 ¤
First three octets are the same – Perform local delivery!
Two Other examples ¨
192.168.163.24 with subnet mask of 255.255.255.0 ¤ Sends
to 192.168.164.145 ¤ Local or Not?
¨
192.168.163.24 with subnet mask of 255.255.0.0 ¤ Sends
to 192.168.164.145 ¤ Local or Not?
Classless Inter-Domain Routing (CIDR or “Slash” Notation) ¨
¨
¨
Just another way of saying same things as IP address and Subnet Mask Specify address and number of bits that represent network Combo of address and subnet mask ¤ 192.168.163.87 n 192.168.163.87
¤ 100.18.73.201 n 100.18.73.201
/24 = mask 255.255.255.0
/8 mask 255.0.0.0
Default Subnet Masks ¨ ¨
Also called “Classful” subnetting Class determined by first octet ¤ Class n 7
A : 1 – 127
(0xxxxxxxx) : 255.0.0.0
bits for network ID
¤ Class
B : 128 – 191 (10xxxxxx) : 255.255.0.0
n 6+8
¤ Class
= 14 bits for network ID
C : 192 – 223 (110xxxxx) : 255.255.255.0
n 5+8+8=21
¤ Class
bits for network ID
D: 224 – 239 (1110xxxx) : multicast ¤ Class E : 240 – 255 (1111xxxx) : reserved
Classful Examples ¨
15.56.240.18 ¤ First
octet (15) between 1 and 127 ¤ Class A network ¤ Default mask = 255.0.0.0 ¨
204.153.163.200 ¤ First
octet (204) between 192 and 223 ¤ Class C network ¤ Default mask = 255.255.255.0
What to use? ¨
Class A ¤ Very
few networks (127 total) ¤ Each has lots of hosts (224 – 2 = 16,777,214) ¨
Class B ¤ Happy
Medium
n 16,384
¨
(214) networks; 65,534 (216 - 2) hosts per net
Class C of networks (221 = 2,097,152) ¤ Only 254 (28 - 2) hosts per network ¤ Lots
Example network
Multiple Class C networks
201.47.51.0
201.47.53.0
201.47.52.0
201.47.50.0
201.47.54.0
Multi-Class C Plus/Minus ¨
Positives ¤ Each
sub-network has own network address ¤ All subnets can be routed out to Internet ¨
Negatives ¤ Need ¤
multiple, full, Class-C addresses (good luck)
Private IP Addresses ¨
Reserved by Internet committees for “internal”, private use ¤ Not
routable on The Internet
¨
1 class A :: 10.0.0.0
¨
16 class B's :: 172.16.0.0 – 172.31.0.0
¨
255 class C's :: 192.168.x.0
¨
APIPA :: 169.254.0.0 ¤ Automatic
Private IP Addressing
Use Private IP addresses
192.168.10.0
192.168.30.0
192.168.20.0
192.168.1.0
192.168.40.0
Private IP Address Plus/Minus ¨
Positives ¤ Each
sub-network has own network address ¤ No “real” addresses needed n ONE n
¨
address needed if want to get out
(see below)
Negatives ¤ Need
something else to get out to internet
n Network
Address Translation (NAT) n Translates the Private addresses inside into a “real” address on the outside
Use of NAT
IP Addressing Basics Summary ¨ ¨
IP address is 32-bits long Part of IP address will be network ¤ Rest
of IP address with be host
Number of bits in network determined by Subnet Mask ¨ Each node must have unique IP address ¨ Each network (subnet) needs a unique “Network” address ¨
¤ All
hosts on a given physical subnet must have the same network address ¤ Hosts on different physical subnets must have different network addresses