Unit 2 Introduction to TCP/IP Addressing Outline

cursefarmΔίκτυα και Επικοινωνίες

24 Οκτ 2013 (πριν από 3 χρόνια και 7 μήνες)

133 εμφανίσεις

Unit 2
Introduction to TCP/IP Addressing
Outline
Why do we need addresses?
Classful IP Addressing
Address Classes
Network Mask - Prefix
Host Addresses
Subnetting
Define Subnets
Determine Host Addresses
VLSM (Variable Length Subnet Masks)
Supernetting - CIDR
Why do we need IP addresses?
172.31.0.11
172.310.0
172.31.0.67
10.0.0.0
10.0.0.33
10.0.0.20
172.31.0.1
192.168.21.0
192.168.21.123
192.168.0.1
192.168.0.2 192.168.1.1
192.168.1.2
10.0.0.1
192.168.2.1
192.168.2.2
HDR
SA
DA
DATA
HDR
SA
DA
DATA

Unique addressing permits identifying IP devices

Unique addressing allows IP devices to
communicate

Unique addressing allows to select path to IP device
Note that an IP device with more than one interface requires a
unique IP address per interface
Classful IP Addressing
Two-level IP address structure
Class A
Network Number 24 bits
Host Number
8 bits
Network Number
8bits
Host Number 24 bits
Class B
Network Number 16 bits
Host Number 16 bits
Class C
Network Number
Host Number
32 bits
Classful IP Addressing (cnt’d)
Class B
Class C
Class A
0
Network Number
7 bits
Host Number 24 bits
Network Number 21 bits
Host Number
8 bits
1
1
0
1
0
Network Number 14 bits
Host Number 16 bits
1
1
1
0
Group Identifier 28 bits
Class D -- Multicast
Class E -- Reserved
1
1
1
1
28 bits
Classful IP Addressing (cnt’d)
7
0
1
5
8
2
3
1
6
3
1
2
4
.
.
.
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
Dotted-Decimal Notation
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
128
64
32
16
8
4
1
2
128
64
32
16
8
4
1
2
128
64
32
16
8
4
1
2
128
64
32
16
8
4
1
2
146
0
1
0
0
1
0
0
1
31
.
.
.
.
.
0
0
1
0
1
0
1
1
1
1
1
1
1
0
0
0
0
0
1
0
1
0
1
1
172
212
.
52
168
.
.
.
.
.
192
89
.
0
0
0
0
0
1
1
0
0
0
0
1
0
1
0
1
0
0
1
0
1
1
0
0
1
0
0
1
1
0
1
0
Example 1:
Example 2:
Classful IP Addressing
Network Mask
Network Number
Host Number
/16 prefix
52
00101100
168
.
.
.
.
.
0000011 0 00010101 10011010
192 89
.
.
.
.
00000000
1
1
1
1
1
1
1
1
.
1
1
1
1
1
1
1
1
.
.
00000000
255
255
/24 prefix
255
1
1
1
1
1
1
1
1
146
01001001
31
.
.
.
.
.
0010101 1 11111000 00101011
172 212
.
.
.
.
1
1
1
1
1
1
1
1
.
1
1
1
1
1
1
1
1 00000000
.
.
00000000
255
255 0 0
Network Number
Host Number
Classful Addressing
Determining Host Addresses
172.31.0.1/16
Host
#1:
172.31.0.2/16
Host
#2:
172.31.0.255/16
Host
#255:
172.31.1.0/16
Host
#256:
172.31.255.253/16
Host
#65533:
172.31.255.254/16
Host
#65534:
172.31.1.1/16
Host
#257:
172.31.0.0/16
Base
Network:
.
172
31
.
.
00000000 00000000
.
172
31
.
0
1
0
0
0
0
0
0
.
0
0
0
0
0
0
0
0
.
172
31
.
1
0
0
0
0
0
0
0
.
0
0
0
0
0
0
0
0
.
172
31
.
1
1
1
1
1
1
1
1
.
0
0
0
0
0
0
0
0
.
172
31
.
0
0
0
0
0
0
0
0
.
1
0
0
0
0
0
0
0
.
172
31
.
1
0
0
0
0
0
0
0
.
1
0
0
0
0
0
0
0
.
172
31
.
1
0
1
1
1
1
1
1
.
1
1
1
1
1
1
1
1
172.31.255.252/16
Host
#65532:
.
172
31
.
0
0
1
1
1
1
1
1
.
1
1
1
1
1
1
1
1
.
172
31
.
0
1
1
1
1
1
1
1
.
1
1
1
1
1
1
1
1
Classful Addressing
Determining Host Addresses (cnt’d)
 Host Number field with all 0’s cannot be used to number
a host. It is used to address the network.
 Host Number field with all 1’s cannot be used to number
a host. It is used for broadcast on the network.
Subnetting - Define Subnets
Subnet 192.168.50.0/24 into 8 subnets
3 bits are required to number 8 subnets
leaving 5 bits to number 30 hosts in each subnet
0
0
0
0
0
0
0
0
.
192
168
50
.
.
base network:192.168.50.0/24
.
192
168
50
.
.
0
0
0
0
0
0
0
0
subnet #0:192.168.50.0/27
.
192
168
50
.
.
1
0
0
0
0
0
0
0
subnet #1:192.168.50.32/27
.
192
168
50
.
.
0
1
0
0
0
0
0
0
subnet #2:192.168.50.64/27
.
192
168
50
.
.
1
1
0
0
0
0
0
0
subnet #3:192.168.50.96/27
.
192
168
50
.
.
0
0
0
0
0
0
0
1
subnet #4:192.168.50.128/27
0
0
0
0
0
1
0
1
.
192
168
50
.
.
subnet #5:192.168.50.160/27
.
192
168
50
.
.
0
1
1
0
0
0
0
0
subnet #6:192.168.50.192/27
.
192
168
50
.
.
1
1
1 00000
subnet #7:192.168.50.224/27
Subnets with All 0’a and All 1’s
A subnet with all bits are 0's can be used.
However devices and routing protocols (e.g., RIP version 1) that do
not understand classless addressing can be problem. They cannot
distinguish between the base network address and the all 0's subnet
address
0
0
0
0
0
0
0
0
.
192
168
50
.
.
base network:192.168.50.0/24
.
192
168
50
.
.
0
0
0
0
0
0
0
0
subnet #0:192.168.50.0/27
A subnet with all bits are 1's can be used.
The same issue for classful routers. Cannot distinguish between:
broadcast to subnet with all 1's (subnet #7 in above example)
.
192
168
50
.
.
1
1
1
1
1
1
1
1
subnet #7:
192.168.50.0/27
and broadcast to network:
.
192
168
50
.
.
111
1
1
1
1
1
base network:
192.168.50.0/24
Subnetting
Determine Host Addresses for Subnet #3
In each subnet: 5 bits in host number field
30 hosts may be numbered (2
5
- 2)
host number field with all zeros and with all 1's cannot be used

subnet #3:192.168.50.96/27
host #1:192.168.50.97/27
host #2 192.168.50.98/27
host #15:192.168.50.111/27
host #16 192.168.50.112/27
.
192
168
50
.
.
1
0
1
1
1
host #29:192.168.50.125/27
1
1
0
.
192
168
50
.
.
00000
0
1
0
0
0
1
0
0
0
0
.
192
168
50
.
.
1
1
0
.
192
168
50
.
.
1
1
0
1
1
1
1
0
.
192
168
50
.
.
1
1
0
.
192
168
50
.
.
0
0
0
0
1
1
1
0
1
1
0
.
192
168
50
.
.
1
1
0
0
1
1
1
1
host #30:192.168.50.126/27
...
...
Subnetting
Determine Host Addresses for Subnet#6
In each subnet: 5 bits in host number field
30 hosts may be numbered (2
5
- 2)
host number field with all zeros and with all 1's cannot be used

subnet #6:192.168.50.192/27
host #1:192.168.50.193/27
host #2 192.168.50.194/27
host #15:192.168.50.207/27
host #16 192.168.50.208/27
.
192
168
50
.
.
1
0
1
1
1
host #29:192.168.50.221/27
0
1
1
.
192
168
50
.
.
00000
0
1
0
0
0
1
0
0
0
0
.
192
168
50
.
.
0
1
1
.
192
168
50
.
.
0
1
1
1
1
1
1
0
.
192
168
50
.
.
0
1
1
.
192
168
50
.
.
0
0
0
0
1
0
1
1
0
1
1
.
192
168
50
.
.
0
1
1
0
1
1
1
1
host #30:192.168.50.222/27
...
...
Subnetting - Define Subnets
Subnet 172.31.0.0/16 into 4 subnets
2 bits are required to number 4 subnets
leaving 14 bits to number 16,382 (2
14
- 2) hosts in each subnet
base network:
172.31.0.0/16
subnet #0:
172.31.0.0/18
172.31.128.0/18
subnet #1:
172.31.128.0/18
.
172
31
.
0
0
0
0
0
0
0
0
.
0
0
0
0
0
0
0
1
subnet #2:
subnet #3:
.
172
31
.
0
0
0
0
0
0
0
0
.
0
0
0
0
0
0
0
0
.
172
31
.
0
0
0
0
0
0
0
0
.
0
0
0
0
0
0
0
0
.
172
31
.
0
0
0
0
0
0
0
0
.
0
0
0
0
0
0
1
0
172.31.192.0/18
.
172
31
.
0
0
0
0
0
0
0
0
.
0
0
0
0
0
0
1
1
Subnetting
Determine Host Addresses for Subnet #2
172.31.64.1/18#1:
172.31.64.2/18#2:
172.31.64.255/18#255:
172.31.65.0/18#256:
172.31.66.0/18#512:
172.31.66.1/18#513:
172.31.65.1/18#257:
172.31.64.0/18
Base
Subnet:
.
172
31
.
.
000000
1
0 00000000
.
172
31
.
0
1
0
0
0
0
0
0
.
0
0
0
0
0
0
1
0
.
172
31
.
1
0
0
0
0
0
0
0
.
0
0
0
0
0
0
1
0
.
172
31
.
1
1
1
1
1
1
1
1
.
0
0
0
0
0
0
1
0
.
172
31
.
0
0
0
0
0
0
0
0
.
1
0
0
0
0
0
1
0
.
172
31
.
1
0
0
0
0
0
0
0
.
1
0
0
0
0
0
1
0
.
172
31
.
0
0
0
0
0
0
0
0
.
0
1
0
0
0
0
1
0
172.31.65.255/18#511:
.
172
31
.
1
1
1
1
1
1
1
1
.
1
0
0
0
0
0
1
0
.
172
31
.
1
0
0
0
0
0
0
0
.
0
1
0
0
0
0
1
0
Subnetting
Determine Host Addresses for Subnet#2
(cnt’d)
172.31.67.1/18#769:
172.31.126.255/18#16127:
172.31.127.0/18#16128:
172.31.127.254/18#16382:
172.31.127.1/18#16129:
.
172
31
.
1
0
0
0
0
0
0
0
.
1
1
0
0
0
0
1
0
.
172
31
.
1
1
1
1
1
1
1
1
.
0
1
1
1
1
1
1
0
.
172
31
.
0
0
0
0
0
0
0
0
.
1
1
1
1
1
1
1
0
.
172
31
.
1
0
0
0
0
0
0
0
.
1
1
1
1
1
1
1
0
.
172
31
.
0
1
1
1
1
1
1
1
.
1
1
1
1
1
1
1
0
172.31.127.253#16381:
.
172
31
.
1
0
1
1
1
1
1
1
.
1
1
1
1
1
1
1
0
172.31.67.0/18#768:
.
172
31
.
0
0
0
0
0
0
0
0
.
1
1
0
0
0
0
1
0
172.31.66.255/18#767:
.
172
31
.
1
1
1
1
1
1
1
1
.
0
1
0
0
0
0
1
0
VLSM
Variable Length Subnet Masks
Why do we need VLSM?
Without VLSM, all subnets in a network will have the same
mask.
Very restrictive:
 If we pick the mask to have enough subnets, we may
not be able to allocate enough hosts in each subnet.
 If we pick the mask to allow enough hosts, we may
not have enough subnet space.
VLSM
Why do we need VLSM? (cnt’d)
LAN 1:
100
hosts
LAN 2:
50 hosts
LAN 3:
50 hosts
Assume we are given a /24 address: 192.168.51.0/24
You may think: 100 + 50 + 50 = 200 hosts < 254 (2
8
- 1)
100 hosts require 7 bits, left with 1 bit to number 2 subnets
cannot be done
50 hosts require 6 bits, left with 2 bits to number 4 subnets,
none of them will support LAN 1 with 100 hosts
cannot be done
ANSWER: Need VLSM
VLSM
Example
172.31.0.0/16
subnet #0:
172.31.0.0/18
subnet #2:
172.31.128.0/18
subnet #3:
172.31.192.0/18
subnet #1:
172.31.64.0/18
subnet #3:
172.31.88.0/21
subnet #2:
172.31.92.0/23
subnet #6:
172.31.112.0/21
subnet #1:
172.31.116.0/22
VLSM
Example (cnt’d)
Further subnet 172.31.64.0/18 into 8 subnets
3 bits are required to number 8 subnets
leaving 11 bits to number 2,046 (2
11
- 2) hosts in each subnet
base
subnet:
172.31.64.0/18
.
172
31
.
0
0
0
0
0
0
0
0
.
0
0
0000
1
0
.
subnet
#1:
172.31.72.0/21
172
31
.
0
0
0
0
0
0
0
0
.
000
1
0
0
1
0
.
subnet
#2:
172.31.80.0/21
172
31
.
0
0
0
0
0
0
0
0
.
000
0
1
0
1
0
.
subnet
#3:
172.31.88.0/21
172
31
.
0
0
0
0
0
0
0
0
.
000
1
1
0
1
0
.
subnet
#4:
172.31.96.0/21
172
31
.
0
0
0
0
0
0
0
0
.
000
0
0
1
1
0
.
subnet
#0:
172.31.64.0/21
172
31
.
0
0
0
0
0
0
0
0
.
000
0
0
0
1
0
.
subnet
#5:
172.31.104.0/21
172
31
.
0
0
0
0
0
0
0
0
.
000
1
0
1
1
0
.
subnet
#6:
172.31.112.0/21
172
31
.
0
0
0
0
0
0
0
0
.
000
0
1
1
1
0
.
subnet
#7:
172.31.120.0/21
172
31
.
0
0
0
0
0
0
0
0
.
000
1
1
1
1
0
Supernetting - CIDR
Route Aggregation
.
172.31.76.0/22
172
31
.
0
0
0
0
0
0
0
0
.
00
1
1
0
0
1
0
.
172.31.76.0/24
172
31
.
0
0
0
0
0
0
0
0
.
0
0
1
1
0
0
1
0
.
172.31.77.0/24
172
31
.
0
0
0
0
0
0
0
0
.
1
0
1
1
0
0
1
0
.
172.31.78.0/24
172
31
.
0
0
0
0
0
0
0
0
.
0
1
1
1
0
0
1
0
.
172.31.79.0/24
172
31
.
0
0
0
0
0
0
0
0
.
1
1
1
1
0
0
1
0
Supernetting - CIDR
(cnt’d)
Route Aggregation
.
172.31.74.0/23
172
31
.
0
0
0
0
0
0
0
0
.
0
1
0
1
0
0
1
0
.
172.31.74.0/24
172
31
.
0
0
0
0
0
0
0
0
.
0
1
0
1
0
0
1
0
.
172.31.75.0/24
172
31
.
0
0
0
0
0
0
0
0
.
1
1
0
1
0
0
1
0
.
172.31.76.0/24
172
31
.
0
0
0
0
0
0
0
0
.
0
0
1
1
0
0
1
0
.
172.31.77.0/24
172
31
.
0
0
0
0
0
0
0
0
.
1
0
1
1
0
0
1
0
cannot be aggregated as one prefix
However can be aggregated as two separate prefixes
.
172.31.76.0/23
172
31
.
0
0
0
0
0
0
0
0
.
0
0
1
1
0
0
1
0