0% found this document useful (0 votes)
10 views

IP Subnet and IP Routing

IP Subnet and IP Routing

Uploaded by

chakri_kottu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

IP Subnet and IP Routing

IP Subnet and IP Routing

Uploaded by

chakri_kottu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

IP Subnetting and IP Routing

Copyright © Wuhan FiberHome Technical Services Co ., Ltd. All rights reserved.


1. Introduction to IP Address

2. Introduction to IP Subnetting
Contents
3. Introduction to IP Routing

BROADEN YOUR FUTURE


Review of Network Layer
Protocols

 IP
Function  APR, RARP, ICMP
 Logical address definition
 Addressing and Routing
Devices
 IP/MPLS Routers
 L3 PTN……

BROADEN YOUR FUTURE


Format of IP Packets

Version Packet length Service type Total length

Identifier Flag Fragment offset

TTL Protocol Header checksum 20 bytes

Source IP address

Destination IP address

IP options

BROADEN YOUR FUTURE


Structure of IP Address
 An IP address uniquely identifies a network device. It contains 4 bytes,
consisting of 32 bits.

192. 168. 1. 5 Decimal

11000000 10101000 00000001 00000101 Binary

8 bits 8 bits 8 bits 8 bits

 An IP address consists of two parts: network address and host address.

IP address

Network part Host part

uniquely identifies a uniquely identifies a host


network segment. in a network segment

BROADEN YOUR FUTURE


Conversion between the Binary and the Decimal
8 bits

1 1 1 1 1 1 1 1

7 6 5 4 3 2 1 0
2 2 2 2 2 2 2 2

128 64 32 16 8 4 2 1

128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255

8 bits

1 1 1 0 1 0 0 1

7 6 5 4 3 2 1 0
2 2 2 2 2 2 2 2

1*128 1*64 1*32 0*16 1*8 0*4 0*2 1*1

128 + 64 + 32 + 0 + 8 + 0 + 0 + 1 = 233
BROADEN YOUR FUTURE
Typical Conversion Result

BROADEN YOUR FUTURE


Classification of IP Address

1.0.0.0~
0 Network Class A
126.255.255.255 Host(24bits)
(7bits)

128.0.0.0~
191.255.255.255 1 0 Network(14bits) Host(16bits) Class B

192.0.0.0~ Network(21bits) Host(8bits)


223.255.255.255
1 1 0 Class C

224.0.0.0~
239.255.255.255 1 1 1 0 Multicast Address Class D

240.0.0.0~
255.255.255.255 Reserved Class E

BROADEN YOUR FUTURE


Why IP address need a Netmask?

 There are two kinds of Communication between two hosts:

 They are in the same network segment.

 They are in different network segments.

 How to identify network segment?

 If the network address of the source host is equal to the one of the destination host, they
belongs to the same network segment.

 Otherwise , different network segments.

How to extract the network address? By Netmask.

BROADEN YOUR FUTURE


Format of Netmask

 An IPv4 netmask consists of 32 bits, a sequence of ones (1) followed by a block of zeros (0).

 The trailing block of zeros designates that part as being the host identifier.

 For example:

Netmask
Binary Format 11111111 11111111 11111111 00000000

Decimal Format 255 255 255 0

Netmask Length /24

BROADEN YOUR FUTURE


Default Netmask

Binary Format Decimal Format Netmask Length

Class A 11111111 00000000 00000000 00000000 255.0.0.0 /8

Class B 11111111 11111111 00000000 00000000 255.255.0.0 /16

Class C 11111111 11111111 11111111 00000000 255.255.255.0 /24

BROADEN YOUR FUTURE


Determining Network Address

IP address 211 134 27 26


And
Address mask 255 255 255 0
211.134.27.1/24
PC1
Network address 211 134 27 0

Broadcast address 211 134 27 255

PC2
PC3 Addresses for host 211.134.27.1~211.134.27.254

211.134.27.232/24 211.134.28.232/24

BROADEN YOUR FUTURE


Maximum Quantity of Host Addresses

Class Bits of First Range of First Maximum quantity of Maximum quantity of


Octet Octet Networks hosts per network

A 1 1-126 126 16,777,214

B 10 128-191 16,384 65,534

C 110 192-223 2,097,152 254

BROADEN YOUR FUTURE


Special IP Addresses
Network
Host Address Address Type Used to
Address
Any "0" only Network address Stand for a network segment.

Stand for all nodes in the specified


Any "1" only Broadcast address
network segment.

127 Any Loopback address Conduct loopback tests.

"0" only All networks Specify the default route.

"1" only Stand for all nodes in the current


Broadcast address
network segment.

BROADEN YOUR FUTURE


Question 1

1. Which of the following is class-B address?


a) 10.0.1.0

b) 132.127.0.0

c) 192.168.0.1

d) 172.16.0.0

BROADEN YOUR FUTURE


1. Introduction to IP Address

2. Introduction to IP Subnetting
Contents
3. Introduction to IP Routing

BROADEN YOUR FUTURE


Default Netmask brings Waste of IP address
RTA Network RTB
segment 1

Network
segment 2

Quantity of Hosts Network Quantity of Spare IP address

Network segment 1 2 200.1.2.0/24 252

Network segment 2 272 172.21.0.0/16 216-2-272=65262

BROADEN YOUR FUTURE


Subnetting
 The only way to make Class A, B, or C addresses practical is by dividing the network into
lots of subnets.
 The subnet has longer mask(subnet mask), and can accommodate less IP addresses.

Network Part Host Part

Network Part Subnet Part Host Part

192.168.1.64/27

192.168.1.96/27

BROADEN YOUR FUTURE


IP Address Calculation

192. 168. 1. 5 IP address


11000000 10101000 00000001 00000101
255 255 255 240 Subnet Mask
11111111 11111111 11111111 11110000

Class C netmask part Subnet part Host part

Network segment address:


11000000 10101000 00000001 00000000 192.168.1.0
… … … …
Broadcast address:
11000000 10101000 00000001 00001111
192.168.1.15

Total number of hosts: 24, with 16(=24-2) hosts available.


Host address: 192.168.1.1 to 192.168.1.14

BROADEN YOUR FUTURE


Question 2
 A company was assigned to class C address 201.222.5.0.
 20 subnets are required, and each of which has five hosts.
 How do we design the subnets?

Subnet Available host IP address


1 201.222.5.0/29 201.222.5.1~201.222.5.6
2 201.222.5.8/29 201.222.5.9~201.222.5.14
3 201.222.5.16/29 201.222.5.17~201.222.5.22
…… ……
18 201.222.5.232/29 201.222.5.233~201.222.5.238
19 201.222.5.240/29 201.222.5.241~201.222.5.246
20 201.222.5.248/29 201.222.5.249~201.222.5.254

BROADEN YOUR FUTURE


Question 3

In the network segment address 202.162.0.0/26.


1)How many subnets?
2)How many hosts in each subnet?
3)What are the subnet addresses?
4)What the broadcast address of each subnet?
5)What are the available IP addresses in each subnet?

BROADEN YOUR FUTURE


Variable Length Subnet Mask (VLSM)
201.168.1.32/27

201.168.1.64/27

201.168.1.96/27

201.168.1.128/27

 The more host addresses, the shorter the subnet mask.


 The less host addresses, the longer the subnet mask.

BROADEN YOUR FUTURE


Classless Inter-Domain Routing (CIDR)

198.168.1.0/24

border router

Internet 198.168.2.0/24

Advertise
198.168.0.0/16
198.168.3.0/24

 CIDR reduces scale of routing table and enhances network extensibility.

BROADEN YOUR FUTURE


Question 4
 Please calculate the aggregated address.

172.24.0.0/16=10101100 00011 000 00000000 00000000


172.24.0.0/16
172.25.0.0/16=10101100 00011 001 00000000 00000000
172.25.0.0/16
172.26.0.0/16=10101100 00011 010 00000000 00000000
172.26.0.0/16
172.27.0.0/16=10101100 00011 011 00000000 00000000
172.27.0.0/16
172.28.0.0/16=10101100 00011 100 00000000 00000000
172.28.0.0/16
172.29.0.0/16=10101100 00011 101 00000000 00000000
172.29.0.0/16
172.30.0.0/16=10101100 00011 110 00000000 00000000
172.30.0.0/16
172.31.0.0/16=10101100 00011 111 00000000 00000000
172.31.0.0/16 10101100 00011 000 00000000 0000000
Address:
172.24.0.0/13
Mask: 11111111 11111 000 00000000 0000000

BROADEN YOUR FUTURE


1. Introduction to IP Address

2. Introduction to IP Subnetting
Contents
3. Introduction to IP Routing

BROADEN YOUR FUTURE


Process of IP Routing

Desti./MASK NEXTHOP
Desti./MASK NEXTHOP
100.1.0.0/16 DIRECT
100.1.0.0/16 R2
…..
….. R2 (100.1.0.0)
Desti./MASK NEXTHOP

100.1.0.0/16 R1 R1

…..

100.1.1.1

R5
(200.2.0.0)
R3
R4

BROADEN YOUR FUTURE


Components of Routes
nexthop
Destination/Mask Administrative Metric
Protocol Distance Out-interface

a route

BROADEN YOUR FUTURE


How are the routes generated?
 Source of routes:
 Direct route:the links are direct connected, and routes are automatic discovered.
 Static route:the routes are manually configured.
 Dynamic route:the routes are discovered and calculated by routing protocols such as BGP,
ISIS, OSPF and RIP, etc.
Administrative
Source
Distance Static OSPF
connected 0

OSPF 110

STATIC 1

ISIS 115 or 116


10.0.0.0 R0 10.0.0.0 R1
BGP 200

UNKNOWN 255 10.0.0.0 R0


Routing table
BROADEN YOUR FUTURE
Example of Direct Route
Ethernet0/2
10.1.1.0/30
RTB
RTA
.1 .2
Ethernet0/1
.1
10.1.2.0/30

[RTB]show ip route
Destination/Mask Protocol Administrative Distance Metric Nexthop Interface
10.1.1.0/30 connected 0 0 10.1.1.1 Ethernet0/2
10.1.1.1/32 connected 0 0 127.0.0.1 InLoopBack0
.2
10.1.2.1/32 connected 0 0 127.0.0.1 InLoopBack0
10.1.2.0/30 connected 0 0 10.1.2.2 Ethernet0/1

RTC

BROADEN YOUR FUTURE


Example of Static Route
Ethernet0/1
RTA RTB
10.1.1.0/30
Configure the route to reach 2.2.2.2/32
.1 .2

2.2.2.2/32

[RTA] show ip route


Destination/Mask Protocol Administrative Distance Metric Nexthop Interface
2.2.2.2/32 Static 1 0 10.1.2.2 Ethernet0/1
10.1.1.0/30 connected 0 0 10.1.1.1 Ethernet0/1
10.1.1.1/32 connected 0 0 127.0.0.1 InLoopBack0

BROADEN YOUR FUTURE


Configuration of Static Route
 Manually create a route that specifies Destination/mask, the nexthop or out interface

Command on PC:

Command on devices: router(config) # ip route 50.13.100.0/24 50.8.1.1

A B C
.1 .2 .1 .2

10.1.1.0/24 10.4.4.0/24
10.2.2.0/24 10.3.3.0/24

• Requirement: 10.1.1.0/2/24 visits 10.4.4.0/24


• How many static routes?

BROADEN YOUR FUTURE


Default Route

 Default route is a special kind of routing.


 Default route is used when no matching route is found.
 In the routing table, the default route is represented as destination 0.0.0.0 (with mask
0.0.0.0).
 Application: when there is only one exit (that is, gateway) to other segments.
A B C
.1 .2 .1 .2

10.1.1.0/24 10.4.4.0/24
10.2.2.0/24 10.3.3.0/24

RouterA(config) # ip route 0.0.0.0 0.0.0.0 10.2.2.2

BROADEN YOUR FUTURE


Example of Dynamic Route
172.16.1.1/32

RTC

10.1.2.0/24
.2
OSPF

RTA
[RTB]show ip route
ISIS .1 Ethernet0/1
Destination/Mask Protocol Administrative Distance Metric Nexthop Interface
10.1.1.0/30 10.1.1.0/30 connected 0 0 10.1.1.2 Ethernet0/1
.2 .1 10.1.1.1/32 connected 0 0 127.0.0.1 InLoopBack0
Ethernet0/2
192.168.2.1/24 RTB ……
172.16.1.1/32 OSPF 110 10 10.1.2.2 Ethernet0/1
192.168.1.0/24 ISIS 115 10 10.1.1.1 Ethernet0/2

BROADEN YOUR FUTURE


Classification of Dynamic Routing Protocols
AS 100

 According to the working range:


ISIS
ISIS
 Distance Vector: such as RIP, BGP
 Link State: such as OSPF, ISIS ISIS
ISIS
 According to the working algorithm:
 Internal gateway protocol (IGP) : RIP, OSPF, ISIS. BGP
 External gateway protocol (EGP) : such as BGP.

OSPF OSPF
An autonomous system (AS) is a collection of connected routers
under the control of one operators on behalf of a single
administrative entity or domain that presents a common, clearly
defined routing policy to the Internet. OSPF
OSPF
AS 200

BROADEN YOUR FUTURE


Working Range Of MAC and IP Address
 MAC addresses are used to communicate within the same subnet, and IP
addresses are used to communicate across segments.
 MAC addresses are physical addresses, and IP addresses are logical addresses.
A B
E1 E1
.2 .1
.1 .2
E0
.1 E0 .2
10.2.2.0/24

PC2
PC1

Working Range of MAC address

Working Range of IP address

BROADEN YOUR FUTURE


ARP Protocol
 Address Resolution Protocol (ARP) is used to acquire the MAC address of a specific IP
address.
 ARP request message is to require Destination MAC address of a specific IP address .
 ARP reply message is to advertise
Sender
theMAC: Sender
required IP:
DestinationTarget
MACMAC:
address.Target IP:
MAC1 IP1 00-00-00-00-00-00 IP2
ARP request message
PC1 PC2
SW

IP1 IP2
MAC1 MAC2
ARP reply message

Sender MAC: Sender IP: Target MAC: Target IP:


MAC2 IP2 MAC1 IP1

BROADEN YOUR FUTURE


Example of an ARP (1/2)
 PC1 sends a message to PC2.Assuming there is no corresponding table item in the ARP
table.
MAC address of nexthop?
ARP request
A B ARP reply
E1 E1
.2 .1
E0 .1 .2
.1 10.2.2.0/24 E0 .2

PC1 PC2
I know, =MACb.1
I know, =MAC2

Port E0 of Port E1 of Port E1 of Port E0 of


PCI PC2
Router A Router A Router B Router B

IP address IP1 IPa.0 IPa.1 IPb.1 IPb.0 IP2

MAC address MAC1 MACa.0 MACa.1 MACb.1 MACb.0 MAC2

BROADEN YOUR FUTURE


Example of an ARP (2/2)
 According to the instructions of ARP table, PC1 completes the packaging and sends a
message to PC2.
DMAC SMAC DIP SIP
MAC2 MACb.0 IP2 IP1
DMAC SMAC DIP SIP
MACa.0 MAC1 IP2 IP1 A B
E1 E1
.2 .1
PC1.1 E0 .1 .2
10.2.2.0/24 E0 .2 IP Packet

DMAC SMAC DIP SIP


MACb.1 MACa.1 IP2 IP1
PC2

Application layer 5 Application layer 5

Transport layer 4 Transport layer 4


Network layer 3 Network layer Network layer
Network layer 3
Data link layer 2 Data link layer Data link layer Data link layer 2
Physical layer 1 Physical layer Physical layer Physical layer 1

BROADEN YOUR FUTURE


Question 5
 Please indicate the source destination IP and MAC addresses of the packet at points A, B, C
and D?

IP1/MAC1 IP2/MAC2 IP3/MAC3

Internet
PC1 SW1 Router1 IP4/MAC4

D
A B C
Server1

BROADEN YOUR FUTURE


THANKS!

You might also like