Professional Documents
Culture Documents
Topics
172.16.1.0
255.255.255.0
Network
Host
Network 172.16.1.0/24
Need:
As many subnets as possible, 60 hosts per subnet
4
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 0 0 0 0 0 0 0 0
Network
Host
6 host bits
Network 172.16.1.0/24
Need:
As many subnets as possible, 60 hosts per subnet
5
Number of subnets
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 1 1 0 0 0 0 0 0
Network
Host
255.255.255.192
6 host bits
Network 172.16.1.0/24
Need:
As many subnets as possible, 60 hosts per subnet
New Subnet Mask: 255.255.255.192 (/26)
Number of Hosts per subnet: 6 bits, 64-2 hosts, 62 hosts
Number of Subnets: 2 bits or 4 subnets
172.16.1.0
255.255.255.0
Network
Host
Network 172.16.1.0/24
Need:
As many subnets as possible, 12 hosts per subnet
7
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 0 0 0 0 0 0 0 0
Network
Host
4 host bits
Network 172.16.1.0/24
Need:
As many subnets as possible, 12 hosts per subnet
8
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 1 1 1 1 0 0 0 0
Network
Host
255.255.255.240
4 host bits
Network 172.16.1.0/24
Need:
As many subnets as possible, 12 hosts per subnet
New Subnet Mask: 255.255.255.240 (/28)
Number of Hosts per subnet: 4 bits, 16-2 hosts, 14 hosts
Number of Subnets: 4 bits or 16 subnets
172.16.1.0
255.255.255.0
Network
Host
Network 172.16.1.0/24
Need:
Need 6 subnets, as many hosts per subnet as possible
10
Number of subnets
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 0 0 0 0 0 0 0 0
3 subnet bits
Network
Host
Network 172.16.1.0/24
Need:
Need 6 subnets, as many hosts per subnet as possible
11
Number of subnets
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 1 1 1 0 0 0 0 0
3 subnet bits
Network
255.255.255.224
Host
Network 172.16.1.0/24
Need:
Need 6 subnets, as many hosts per subnet as possible
New Subnet Mask: 255.255.255.224 (/27)
Number of Hosts per subnet: 5 bits, 32-2 hosts, 30 hosts
Number of Subnets: 3 bits or 8 subnets
12
VLSM
If you know how to subnet, you can do VLSM.
Example: 10.0.0.0/8
Subnet in /16 subnets:
10.0.0.0/16
10.1.0.0/16
10.2.0.0/16
10.3.0.0/16
Etc.
Subnet one of the subnets (10.1.0.0/16)
10.1.0.0/24
10.1.1.0/24
10.1.2.0/24
10.1.3.0/24
etc
14
VLSM
10.2.1.55/24
10.2.1.55/16
NO!
15
16
17
16 /30 subnets
16 /30 subnets
18
Classful Subnetting
Classful IP Addressing
21
Address Classes
1st octet
2nd octet
3rd octet
4th octet
Class A
Network
Host
Host
Host
Class B
Network Network
Host
Host
Class C
Host
22
Class A addresses
Number
between 0 - 127
Host
Host
Host
8 bits
8 bits
8 bits
23
Class B addresses
Number
between
128 - 191
Host
Host
8 bits
8 bits
24
Class C addresses
Host
8 bits
Number
between
192 - 223
25
The network portion of the IP address was dependent upon the first octet.
There was no Base Network Mask provided by the ISP.
The network mask was inherent in the address itself.
27
Class D Addresses
A Class D address begins with binary 1110 in the first octet.
First octet range 224 to 239.
Class D address can be used to represent a group of hosts called a host
group, or multicast group.
Class E Addresses
First octet of an IP address begins with 1111
Class E addresses are reserved for experimental purposes and should not
be used for addressing hosts or multicast groups.
28
29
Class A
through
3. 172.30.77.5
Class B
Default Mask: 255.255.0.0
Network: 172.30.0.0
Broadcast: 172.30.255.255
Hosts: 172.30.0.1. through 172.30.255.254
30
3. 172.30.77.5 Class B
Network: 172.30.0.0
31
First
Bits
First
Octet
Network
Bits
Host
Bits
0 127
24
10
128 - 191
16
16
110
192 - 223
24
1110
224 239
1111
240 - 255
32
IP addressing crisis
Address Depletion
Internet Routing Table Explosion
33
IPv4 Addressing
Subnet Mask
One solution to the IP address shortage was thought to be the subnet mask.
Formalized in 1985 (RFC 950), the subnet mask breaks a single class A, B
or C network in to smaller pieces.
This does allow a network administrator to divide their network into subnets.
Routers still associated an network address with the first octet of the IP
address.
34
36
11111111.00000000.00000000.00000000 /8 (255.0.0.0)
16,777,216 host addresses
11111111.10000000.00000000.00000000 /9 (255.128.0.0)
8,388,608 host addresses
ISPs
no longer restricted to
11111111.11000000.00000000.00000000
/10 (255.192.0.0)
4,194,304 host addresses
three
classes. Can now
11111111.11100000.00000000.00000000
/11 (255.224.0.0)
2,097,152 host addresses
allocate
a large range of
11111111.11110000.00000000.00000000
/12 (255.240.0.0)
1,048,576 host addresses
network
addresses based
11111111.11111000.00000000.00000000
/13 (255.248.0.0)
524,288 host addresses
on11111111.11111100.00000000.00000000
customer requirements
/14 (255.252.0.0)262,144 host addresses
11111111.11111110.00000000.00000000 /15 (255.254.0.0) 131,072 host addresses
11111111.11111111.00000000.00000000 /16 (255.255.0.0) 65,536 host addresses
11111111.11111111.10000000.00000000 /17 (255.255.128.0)
32,768 host addresses
11111111.11111111.11000000.00000000 /18 (255.255.192.0)
16,384 host addresses
11111111.11111111.11100000.00000000 /19 (255.255.224.0)
8,192 host addresses
11111111.11111111.11110000.00000000 /20 (255.255.240.0)
4,096 host addresses
11111111.11111111.11111000.00000000 /21 (255.255.248.0)
2,048 host addresses
11111111.11111111.11111100.00000000 /22 (255.255.252.0)
1,024 host addresses
11111111.11111111.11111110.00000000 /23 (255.255.254.0)
512 host addresses
11111111.11111111.11111111.00000000 /24 (255.255.255.0)
256 host addresses
11111111.11111111.11111111.10000000 /25 (255.255.255.128)
128 host addresses
11111111.11111111.11111111.11000000 /26 (255.255.255.192)
64 host addresses
11111111.11111111.11111111.11100000 /27 (255.255.255.224)
32 host addresses
11111111.11111111.11111111.11110000 /28 (255.255.255.240)
16 host addresses
11111111.11111111.11111111.11111000 /29 (255.255.255.248)
8 host addresses
11111111.11111111.11111111.11111100 /30 (255.255.255.252)
4 host addresses
11111111.11111111.11111111.11111110 /31 (255.255.255.254)
2 host addresses
38
11111111.11111111.11111111.11111111 /32 (255.255.255.255)
Host Route
http://bgp.potaroo.net/
39
N e tw o rk
S e r v ic e
P r o v id e r
R e g io n a l
S e r v ic e
P r o v id e r
IS P
S u b s c r ib e r s
IS P
S u b s c r ib e r s
IS P
S u b s c r ib e r s
N e tw o rk
S e r v ic e
P r o v id e r
R e g io n a l
S e r v ic e
P r o v id e r
R e g io n a l
S e r v ic e
P r o v id e r
IS P
IS P
S u b s c r ib e r s
S u b s c r ib e r s
R e g io n a l
S e r v ic e
P r o v id e r
IS P
S u b s c r ib e r s
IS P
S u b s c r ib e r s
IS P
S u b s c r ib e r s
40
IPv6
Background
That short-term solution was Network Address Translation (NAT) and RFC
1918.
There are two fundamental drivers behind the growing recognition of the need
for IPv6. (NAT stifles innovation in these areas.)
New applications using core concepts such as:
mobile IP
service quality guarantees
end-to-end security
peer-to-peer networking.
Rapid modernization of heavily populated countries such as India and
China.
A compelling statistic is that the number of remaining unallocated IPv4
addresses is almost the same as the population of China: about 1.3
billion.
42
IPv6
IPv6 replaces the 32-bit IPv4 address with a 128-bit address, making 340
trillion trillion trillion IP addresses available.
340,282,366,920,938,463,463,374,607,431,768,211,456 addresses
Represented by breaking them up into eight 16-bit segments.
Each segment is written in hexadecimal between 0x0000 and 0xFFFF,
separated by colons.
An example of a written IPv6 address is
3ffe:1944:0100:000a:0000:00bc:2500:0d0b
43
44
45
Subnet Identifier is part of the network portion of the address rather than the
host portion.
A big benefit is that the Interface ID can be a consistent size for all IPv6
addresses.
And making the Subnet ID a part of the network portion creates a clear
separation of functions:
The network portion provides the location of a device down to the specific
data link
and
the host portion provides the identity of the device on the data link.
46
Background
IPv4 will exist for some time, as the transition begins to IPv6.
Other new protocols have been developed in support of IPv6:
Routing protocols (OSPFv3) so routers can learn about IPv6
network addresses.
ICMPv6
48
49
Ethernet Header
(Layer 2)
Ethernet
Destination
Address
(MAC)
Ethernet
Source
Address
(MAC)
Frame
Type
IP Header
(Layer 3)
ICMP Message
(Layer 3)
Source IP Add.
Dest. IP Add.
Protocol field
Type
0 or 8
Code
0
Ether.
Tr.
Checksum
ID
Seq.
Num.
Data
FCS
Partial list
ICMP
Ethernet Header
(Layer 2)
Ethernet
Destination
Address
(MAC)
Ethernet
Source
Address
(MAC)
Frame
Type
IP Header
(Layer 3)
ICMP Message
(Layer 3)
Source IP Add.
Dest. IP Add.
Protocol field
Type
0 or 8
Code
0
Ether.
Tr.
Checksum
ID
Seq.
Num.
Data
FCS
52
172.30.1.20
172.30.1.25
53
Ethernet Header
(Layer 2)
Ethernet
Destination
Address
(MAC)
Ethernet
Source
Address
(MAC)
Frame
Type
IP Header
(Layer 3)
ICMP Message
(Layer 3)
Source IP Add.
Dest. IP Add.
Protocol field
Type
0 or 8
Code
0
Ether.
Tr.
Checksum
ID
Seq.
Num.
Data
FCS
Ping
Uses ICMP message encapsulated within an IP Packet
Protocol field = 1
Does not use TCP or UDP
Format
ping ip address (or ping <cr> for extended ping)
ping 172.30.1.25
54
Ethernet Header
(Layer 2)
Ethernet
Destination
Address
(MAC)
Ethernet
Source
Address
(MAC)
Frame
Type
IP Header
(Layer 3)
Source IP
Add.
172.30.1.20
Dest. IP Add.
172.30.1.25
Protocol field
1
Type
8
Code
0
Checksum
ID
Seq.
Num.
Ether.
Tr.
Data
FCS
Echo Request
The sender of the ping, transmits an ICMP message, Echo Request
Echo Request - Within ICMP Message
Type = 8
Code = 0
55
Ethernet Header
(Layer 2)
Ethernet
Destination
Address
(MAC)
Ethernet
Source
Address
(MAC)
Frame
Type
IP Header
(Layer 3)
Source IP
Add.
172.30.1.25
Dest. IP Add.
172.30.1.20
Protocol field
1
Type
0
Code
0
Checksum
ID
Ether.
Tr.
Seq.
Num.
Data
FCS
Echo Reply
The IP address (destination) of the ping, receives the ICMP message,
Echo Request
The ip address (destination) of the ping, returns the ICMP message, Echo
Reply
Echo Reply - Within ICMP Message
Type = 0
Code = 0
56
Ping example
57
Pings
may fail
58
Traceroute
Traceroute is a utility that records the route (router IP addresses) between two devices on different networks.
59
Tracroute
http://en.wikipedia.org/wiki/Traceroute
On modern Unix and Linux-based operating systems, the traceroute utility
by default uses UDP datagrams with a destination port number starting at
33434.
The traceroute utility usually has an option to specify use of ICMP echo
request (type 8) instead.
The Windows utility uses ICMP echo request, better known as ping
packets.
Some firewalls on the path being investigated may block UDP probes but
allow the ICMP echo request traffic to pass through.
There are also traceroute implementations sending out TCP packets, such
as tcptraceroute or Layer Four Trace.
In Microsoft Windows, traceroute is named tracert.
A new utility, pathping, was introduced with Windows NT, combining ping
and traceroute functionality. All these traceroutes rely on ICMP (type 11)
packets coming back.
60
Trace (Traceroute)
Trace
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
62
Trace
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
DA = 192.168.10.2, TTL = 1
IP Header
(Layer 3)
Source IP
Add.
10.0.0.1
Dest. IP Add.
192.168.10.2
Protocol field
1
TTL
1
Chk
sum
ID
Seq.
Num
Data
UDP
(Layer 4)
DestPort
35,000
DataLink
Tr.
FCS
Code
0
Trace
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
IP Header
(Layer 3)
Source IP
Add.
10.0.0.2
Dest. IP Add.
10.0.0.1
Protocol field
1
Chk
sum
ID
Seq
.
Nu
m.
Data
DataLink
Tr.
FCS
RTB - TTL:
When a router receives an IP Packet, it decrements the TTL by 1.
If the TTL is 0, it will not forward the IP Packet, and send back to the source
an ICMP time exceeded message.
ICMP Message: Type = 11, Code = 0
64
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
IP Header
(Layer 3)
Source IP
Add.
10.0.0.2
Dest. IP Add.
10.0.0.1
Protocol field
1
Chk
sum
ID
Seq
.
Nu
m.
Data
DataLink
Tr.
FCS
RTB
After the traceroute is received by the first router, it decrements the TTL by 1
to 0.
Noticing the TTL is 0, it sends back a ICMP Time Exceeded message back
to the source, using its IP address for the source IP address.
Router Bs IP header includes its own IP address (source IP) and the sending
hosts IP address (dest. IP).
65
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
IP Header
(Layer 3)
Source IP
Add.
10.0.0.2
Dest. IP Add.
10.0.0.1
Protocol field
1
Chk
sum
Code
0
ID
Seq
.
Nu
m.
Data
DataLink
Tr.
FCS
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
DA = 192.168.10.2, TTL = 2
IP Header
(Layer 3)
Source IP
Add.
10.0.0.1
Dest. IP Add.
192.168.10.2
Protocol field
1
TTL
2
Chk
sum
ID
Seq.
Num
Data
UDP
(Layer 4)
DestPort
35,000
DataLink
Tr.
FCS
Code
0
RTA
The traceroute program increments the TTL by 1 (now 2 ) and resends the
ICMP Echo Request packet.
67
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
DA = 192.168.10.2, TTL = 2
ICMP Time Exceeded, SA = 172.16.0.2
RTB
This time RTB decrements the TTL by 1 and it is NOT 0. (It is 1.)
So it looks up the destination ip address in its routing table and forwards it on to
the next router.
RTC
RTC however decrements the TTL by 1 and it is 0.
RTC notices the TTL is 0 and sends back the ICMP Time Exceeded message
back to the source.
RTCs IP header includes its own IP address (source IP) and the sending hosts
IP address (destination IP address of RTA).
The sending host, RTA, will use the source IP address of this ICMP Time
Exceeded message to display at the second hop.
68
10.0.0.0/8
172.16.0.0/16
RTA
192.168.10.0/24
RTB
.1
.2
RTC
.1
RTD
.2
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
DA = 192.168.10.2, TTL = 2
ICMP Time Exceeded, SA = 172.16.0.2
RTA to RTB
Data Link Header
(Layer 2)
Data Link
Data Link
Destination
Source
Address
Address
IP Header
(Layer 3)
Source IP
Add.
10.0.0.1
Dest. IP Add.
192.168.10.2
Protocol field
1
TTL
2
Chk
sum
ID
Seq.
Num
Data
UDP
(Layer 4)
DestPort
35,000
DataLink
Tr.
FCS
Code
0
RTB to RTC
Data Link Header
(Layer 2)
Data Link
Data Link
Destination
Source
Address
Address
.
Data Link Header
(Layer 2)
Data Link
Data Link
Destination
Source
Address
Address
IP Header
(Layer 3)
Source IP
Add.
10.0.0.1
Dest. IP Add.
192.168.10.2
Protocol field
1
TTL
1
IP Header
(Layer 3)
Source IP
Add.
172.16.0.2
Dest. IP Add.
10.0.0.1
Protocol field
1
Chk
sum
ID
Seq.
Num
Data
UDP
(Layer 4)
DestPort
35,000
DataLink
Tr.
FCS
Code
0
Chk
sum
ID
Seq
.
Nu
m.
Data
DataLink
Tr.
FCS
69
10.0.0.0/8
172.16.0.0/16
RTA
192.168.10.0/24
RTB
.1
.2
RTC
.1
.2
RTD
.1
.2
DataLink
Tr.
FCS
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
DA = 192.168.10.2, TTL = 2
ICMP Time Exceeded, SA = 172.16.0.2
IP Header
(Layer 3)
Source IP
Add.
172.16.0.2
Dest. IP Add.
10.0.0.1
Protocol field
1
Type
11
Code
0
Chk
sum
ID
Seq
.
Nu
m.
Data
70
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
RTD
.2
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
DA = 192.168.10.2, TTL = 2
ICMP Time Exceeded, SA = 172.16.0.2
DA = 192.168.10.2, TTL = 3
IP Header
(Layer 3)
Source IP
Add.
10.0.0.1
Dest. IP Add.
192.168.10.2
Protocol field
1
TTL
3
Chk
sum
ID
Seq.
Num
Data
UDP
(Layer 4)
DestPort
35,000
DataLink
Tr.
FCS
Code
0
71
10.0.0.0/8
172.16.0.0/16
RTA
192.168.10.0/24
RTB
.1
RTC
.2
.1
RTD
.2
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
DA = 192.168.10.2, TTL = 2
ICMP Time Exceeded, SA = 172.16.0.2
DA = 192.168.10.2, TTL = 3
RTA to RTB
Data Link Header
(Layer 2)
Data Link
Data Link
Destination
Source
Address
Address
IP Header
(Layer 3)
Source IP
Add.
10.0.0.1
Dest. IP Add.
192.168.10.2
Protocol field
1
TTL
3
Chk
sum
Seq.
Num
Data
DataLink
Tr.
FCS
Code
0
RTB to RTC
ID
UDP
(Layer 4)
DestPort
35,000
IP Header
(Layer 3)
Source IP
Add.
10.0.0.1
Dest. IP Add.
192.168.10.2
Protocol field
1
TTL
2
Chk
sum
ID
Seq.
Num
Data
UDP
(Layer 4)
DestPort
35,000
DataLink
Tr.
FCS
Code
0
RTC to RTD
Data Link Header
(Layer 2)
Data Link
Data Link
Destination
Source
Address
Address
IP Header
(Layer 3)
Source IP
Add.
10.0.0.1
Dest. IP Add.
192.168.10.2
Protocol field
1
TTL
1
Chk
sum
ID
Seq.
Num
Data
UDP
(Layer 4)
DestPort
35,000
DataLink
Tr.
FCS
Code
0
72
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
DA = 192.168.10.2, TTL = 2
ICMP Time Exceeded, SA = 172.16.0.2
DA = 192.168.10.2, TTL = 3
RTB
This time RTB decrements the TTL by 1 and it is NOT 0. (It is 2.)
So it looks up the destination ip address in its routing table and forwards it on to the next
router.
RTC
This time RTC decrements the TTL by 1 and it is NOT 0. (It is 1.)
So it looks up the destination ip address in its routing table and forwards it on to the next
router.
RTD
RTD however decrements the TTL by 1 and it is 0.
However, RTD notices that the Destination IP Address of 192.168.0.2 is its own interface.
Since it does not need to forward the packet, the TTL of 0 has no affect.
73
IP Header
(Layer 3)
Source IP
Add.
10.0.0.1
Dest. IP Add.
192.168.10.2
Protocol field
1
TTL
1
Chk
sum
ID
Seq.
Num
Data
UDP
(Layer 4)
DestPort
35,000
DataLink
Tr.
FCS
Code
0
IP Header
(Layer 3)
Source IP
Add.
192.168.10.2
Dest. IP Add.
10.0.0.1
Protocol field
1
Chk
sum
ID
Seq
.
Nu
m.
Data
DataLink
Tr.
FCS
RTD
RTD sends the packet to the UDP process.
UDP examines the unrecognizable port number of 35,000 and sends back an
ICMP Port Unreachable message to the sender, RTA, using Type 3 and
Code 3.
74
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
DA = 192.168.10.2, TTL = 2
ICMP Time Exceeded, SA = 172.16.0.2
DA = 192.168.10.2, TTL = 3
ICMP Port Unreachable, SA = 192.168.10.2
IP Header
(Layer 3)
Source IP
Add.
192.168.10.2
Dest. IP Add.
10.0.0.1
Protocol field
1
Chk
sum
ID
Seq
.
Nu
m.
Data
DataLink
Tr.
FCS
10.0.0.0/8
172.16.0.0/16
RTA
RTB
.1
.2
192.168.10.0/24
RTC
.1
.2
RTD
.1
.2
DA = 192.168.10.2, TTL = 1
ICMP Time Exceeded, SA = 10.0.0.2
DA = 192.168.10.2, TTL = 2
ICMP Time Exceeded, SA = 172.16.0.2
DA = 192.168.10.2, TTL = 3
ICMP Port Unreachable, SA = 192.168.10.2
76
Recommended Reading
77
Chapter 6
IPv4 Addresses Part 3
CIS 81 Networking Fundamentals
Rick Graziani
Cabrillo College
graziani@cabrillo.edu
Last Updated: 4/13/2008