Topic 5 IP Addressing and Subnetting
Topic 5 IP Addressing and Subnetting
SUBNETTING
EGE203 – Topic 5
Topic 5 : Learning Outcomes 2
1 2 3
Identify and able to configure Construct network segments Relate to the use of IPv6
valid IP addresses using the using IPv4 Subnet Addressing Addressing
IPv4 Addressing Scheme
(Topic 5B) (Topic 5C)
(Topic 5A)
Topic 5A – IPv4 Addressing 3
Application
Presentation
Fundamentals Transport
Network
Data Link
Physical
Internet Address Schemes
4
• No IP No Internet
What is an IPv4 Address?
7
128 . 3 . 2 . 65
Dotted-decimal notation
10000000 00000011 00000010 01000001
Binary notation
1 1 1 1 1 1 1 1
[Max value is 255 (because 128+64+32+16+8+4+2+1=255) ] 27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
Classful Addressing
8
5 Classes : A,B, C, D, E
Address 1st Octet 1st Octet Network/Host ID No. of Host per Network
Class Decimal High (N = Network, Networks (Usable
Range Order Bits H=Host) Addresses)
• Network Address
– Use to identify network CANNOT assign to any computer
– 1st IP in a network e.g. 199.3.4.0
• Broadcast Address
– Use to inform ALL computers CANNOT assign to any computer
– LAST IP in a network e.g. 199.3.4.255
Let’s practice
IP Class Valid Address If no, state the reason
(yes/no)
200.1.3.255 C No Broadcast Address
180.23.255.255 B No Broadcast Address
15.0.0.0 A No Network Address
170.20.0.255 B Yes Not Broadcast or Network Address
25.0.255.0 A Yes Not Broadcast or Network Address
30.255.0.0 A Yes Not Broadcast or Network Address
180.22.255.0 B Yes Not Broadcast or Network Address
* 127 is reserved
Subnet Masks
14
Reserved 127.0.0.1
• Port Forwarding
– Let Internet computer access specific computer in private LAN
• E.g. forward port 80 on router to send to Web Server1
Port Forwarding:
204.5.5.5:80 192.168.1.2:80
IP Addressing Example 1
19
E0
R1
LAN A
IP Addressing Example 2
20
S0
S1
R2
S0
S1
E0:200.10.20.1
S0
S1
R1 R3
E0:
192.168.1.254
`
LAN B
PC1: 192.168.1.1 PC2: 192.168.1.2
(Japan)
LAN A (Singapore) PCX: 200.10.20.2
• Give suitable IPs with subnet mask using slash notation for the network
• Write the subnet mask in slash notation To ISP to Internet
S0: _______________
11.11.11.1/8
E1:____________
Sales LAN
192.168.101.1/24
R1
E0:192.168.100.1/24
____________
`
192.168.100.10/24
HR1: ___________
HR2:192.168.100.11/24
____________ 192.168.101.10/24
Sales1: ______________ `
HR LAN 192.168.101.11/24
Sales2: ______________
Review Questions
22
C 192 - 223
Review Questions
23
a) A computer
b) A router
____________
c) A hub
d) A& B
a) 255.0.0.0
b) 255.255.0.0
c) 255.255.255.0
_________________
d) 255.255.255.255
a) 10.0.0.0
b) 150.45.0.0 Class Range
c) 200.2.3.255 A 1 - 126
d) ____________
150.0.255.0 B 128 - 191
C 192 - 223
Review Questions
25
a) 10.5.6.88
b) 172.16.139.26
c) 192.168.6.55 Class Range
d)____________
200.3.7.9 A 1 - 126
B 128 - 191
C 192 - 223
Topic 5A – IPv4 Addressing 26
Application
Presentation
Fundamentals Transport
(Revision) Network
Data Link
Physical
What is an IPv4 Address?
27
128 . 3 . 2 . 65
Dotted-decimal notation
10000000 00000011 00000010 01000001
Binary notation
B • 172.16.0.0 to 172.31.255.255
0111 1111 - 127
C • 192.168.0.0 to 192.168.255.255
• The contiguous “1”s in the subnet mask signify the network portion. The contiguous “0”s in the
subnet mask signify the host portion.
• First address in the network reserved for network, Last address in the network reserved for
broadcast
Topic 5B - IPv4 Subnet Addressing 30
IPv4 Subnet
Addressing
Network and Hosts
31
Router
Switch/Hub
(optional)
Hosts
Network vs Hosts
32
N H H H
8 bits 24 bits
Class B : 16
214 = 16,384 networks; 2 – 2 = 65,534 hosts
N N H H
16 bits
N N N H
8 bits
Problem with Classful Addressing
33
HR2 PC Sales1 PC
HR1 PC 141.14.1.3 141.14.1.4 Sales2 PC
141.14.1.2 141.14.1.5
Finance PC2
141.14.1.9 Finance PC1 Marketing2 PC Marketing1 PC
141.14.1.8 141.14.1.7 141.14.1.6
R1
Is this a good
` Fa0/0: 192.168.1.254
Sales1: 192.168.1.3
network design?
`
Sales1: 192.168.1.4
Type text here
HR1: 192.168.1.1 HR2: 192.168.1.2
S0
Better design?
R1
Fa0/1:192.168.1.129
Sales LAN
Fa0/0:
192.168.1.1
HR1: 192.168.1.2 `
OR
• If you know no. of hosts in each subnet, then use
1 1
128 64 32 16 8 4 2 1
We add up the decimal value of these borrowed bits and get 192.
128 64 32 16 8 4 2 1
1 0 0 0 0 0 0 0 = 128
1 1 0 0 0 0 0 0 = 192
1 1 1 0 0 0 0 0 = 224
1 1 1 1 0 0 0 0 = 240
1 1 1 1 1 0 0 0 = 248
1 1 1 1 1 1 0 0 = 252
1 1 1 1 1 1 1 0 = 254
1 1 1 1 1 1 1 1 = 255
Step 3 – What is the “Magic Number”?
43
HR1: 192.168.1.60 `
N N H H
__
1
128
__
1
64
__
1
32
__
1
16
1__
8
__
4
1 __
2
1 __
1
1
. __ __ __ __
128 64 32 16
__ __ __ __
8 4 2 1
We add up the decimal value of these borrowed bits and get 255.0.
172.30.0.0/24
VLSM (Not Tested) – under EG2709 [For Info]
54
• Long time ago, 1st and last subnet could not be used. Now no such restriction
• Subnet zero All zeros in the subnet
• Last Subnet All 1s in the subnet
• Some network designers are concerned having a mix of very old equipment and
new network devices such that they would avoid using all zeros or all ones in the
subnet field
• RFC 1878 in 1995 stated, "This practice (of excluding all-zeros and all-ones
subnets) is obsolete. Modern software will be able to utilize all definable networks."
Today, the use of subnet zero and the all-ones subnet is generally accepted and
most vendors support their use. However, on certain networks, particularly the ones
using legacy software, the use of subnet zero and the all-ones subnet can lead to
problems.
• Cisco note: Though discouraged, subnet zero and the all-ones subnet have always
been usable. Use of the all-ones subnet and subnet zero is explicitly allowed since
Cisco IOS v12. Before that, need to activate using “ip subnet-zero” command.
Example: 140.50.0.0/24 56
Recap: Subnet A
B
1 - 126
128 - 191
N.H.H.H
N.N.H.H
255.0.0.0
255.255.0.0
/8
/16
C 192 - 223 N.N.N.H 255.255.255.0 /24
Valid IP Addressing (with Subnets)
Class IP Address New Subnet Which Subnet? Network Broadcast Range of Valid Host IP
Anything not the 1st
(CIDR Notation) Mask Address Address Addresses nor the last IP is
C 192.168.5.30 / 25 255.255.255.128 Subnet #0 192.168.5.0 192.168.5.127 192.168.5.1 – 192.168.5.126 usable for host
B 172.18.65.40 / 19 255.255.224.0 Subnet #2 172.18.64.0 172.18.95.255 172.18.64.1 – 172.18.95.254
• Step 1 – Host bits borrowed = 25-24 = 1 (=> it also means 21 subnets will be created)
• Step 2 – New subnet mask (4th octet become 10000000 = 128) => 255.255.255.128
• Step 3 – Magic Number = 256 – 128 = 128
• Step 4 – List the subnets Use this to derive broadcast IP – last IP of previous
Add Magic Number
subnet is the broadcast address
• Subnet #0 - 192.168.5.0
• Subnet #1 – 192.168.5.128
• Step 1 – Host bits borrowed = 19 – 16 = 3 (Borrow 3 bits from the Host Portion 255.255.0.0 )
• Step 2 – New subnet mask (3rd octet become 11100000 = 224) => 255.255.224.0
• Step 3 – Magic Number = 256 – 224 = 32
• Step 4 – List the subnets Add Magic Number
• Subnet #0 - 172.18.0.0
• Subnet #1 – 172.18.32.0
• Subnet #2 – 172.18.64.0 ……..
Router Type Network Next Hop
• As of Jan 2015, IPv6 traffic share reported reaching 4.77%. Check out statistics
on Google
Problem with IPv4 65
• 232 = 4,294,967,296
– there are over 4 billion possible IPv4 addresses
– but many are “wasted” due to the allocation scheme
IP Address Shortage 66
• In the early days of the Internet, IP addresses were allocated to organizations based
on request rather than actual need
• When will IPv4 run out?: check out exhaustion Counter
• Rate of IPv6 adoption? IPv6 connectivity
– Belgium (30%)
– America (14%)
– Germany (13%)
– Asia
– Japan (6%)
– Malaysia (5.9%) U.S.: 14%
China: 1.44%
– Singapore (2.7%) Japan: 6%
• The Regional Internet Registries (RIRs) are responsible, within their assigned
regions, for allocating globally unique IP addresses (IPv4 and IPv6) and
autonomous system numbers
• The world is divided into five RIRs:
– AfriNIC for Africa
– ARIN for America, Canada, parts of the Caribbean & Antarctica.
– APNIC for Asia, Australia, New Zealand
– LACNIC for Latin America and parts of the Caribbean region
– RIPE NCC for Europe, Russia, the Middle East, and Central Asia
70