Beruflich Dokumente
Kultur Dokumente
Tema 6.
Direccionamiento IPv4
Alberto Arellano A. Ing. Msc.
aarellano@espoch.edu.ec
CCNA – CCNP - CCSP
1
IPv4 Address
“The identifier used in the IP layer of the TCP/IP protocol
suite to identify each device connected to the Internet is
called the Internet address or IP address. An IPv4 address
is a 32-bit address that uniquely and universally defines the
connection of a host or a router to the Internet; an IP
address is the address of the interface”.(Berhouz Forouzan)
HOST
TCP/IP uses the term host to refer to an end system that
attaches to the Internet.
HOST
IPv4 Address
11111111111111110000000000000000
An IP address is a hierarchical address that is made up of two parts:
A network portion
A host portion.
Subnet Mask
Used to define the:
Network portion
Host portion
32 bits
Contiguous set of 1’s followed by a contiguous set of 0’s
1’s: Network portion
0’s: Host portion
7
Dividing the Network and Host
Portions
11111111.11111111.00000000.00000000
Expressed as:
Dotted decimal
Ex: 255.255.0.0
Slash notation or prefix length
/16 (the number of one bits)
Example
192 168 11 10
192 168 11 0
The prefix length is the number of bits set to 1 in the subnet mask.
It is written in “slash notation”, a “/” followed by the number of
bits set to 1.
For example:
IP address: 192.168.11.10 255.255.255.0
Is the same as: 192.168.11.10 /24
Valid Subnet Mask Values
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
Subnet Masks
So how do hosts figure out which part of the address is the network portion?
Hosts AND the IPv4 address and the subnet mask.
“1” bits refer to the network portion.
“0” bits refer to the host portion.
Hosts actually use a the Boolean “AND” operation to accomplish this task.
This tells them what network they belong to.
Destination IP Address
A B
192.168.1.100 192.168.2.101
255.255.255.0 255.255.255.0
192.168.1.10 192.168.1.11
Same network?
AND AND
192.168.1.100 192.168.2.101
Same network?
AND AND
DHCP Discover
Mac Address
DHCP Request
IP, MAC Address
Client DHCP
Server
DHCP Offer
IP, Lease time
DHCP Ack
IP, Lease time
Dynamic vs. Static IP
Addressing Quiz
Desktop computer Server Router Switch
Source IP addresses
are always unicast
Unicasts:
Packet travels from one host to another specific host.
Multicasts:
Packet travels from one host to a select number of other hosts.
Supports voice and audio broadcasts, news feeds, distribution of
software, re-imaging clients off peak times.
Broadcasts:
Packet travels from one host to all hosts on the local network.
Destination Address Type
Classful Addressing
Class A /8
Class B /16
Class C /24
IPv4 Address Classes
Address # of Possible # of Possible Total Possible
Class Networks Hosts Addresses
Class A. 255.0.0.0 or /8
Was reserved for governments and extremely large organizations.
Class B. 255.255.0.0 or /8
Was reserved for medium/large organizations.
A 0 0 – 127 8 24
B 10 128 - 191 16 16
TEST-NET addresses:
192.0.2.0 to 192.0.2.255 (192.0.2.0 /24)
Subnetting
Problem: Organizations
have multiple networks
which are independently University Network
managed Engineering Medical
Solution 1: Allocate a School School
separate network
address for each network Library
Difficult to manage
From the outside of
the organization, each
network must be
addressable.
Solution 2: Add another
level of hierarchy to the Subnetting
IP addressing structure
Subnetting Example
Network address 172.16.0.0 with /16 network mask
172.16.0.0/24 172.16.10.0/24
172.16.5.0/24 172.16.25.0/24
34
Basic Idea of Subnetting
Split the host number portion of an IP address into a
subnet number and a (smaller) host number.
Result is a 3-layer hierarchy
Then:
Subnets can be freely assigned within the organization
Internally, subnets are treated as separate networks
Subnet structure is not visible outside the organization
How your provider (ISP) sees
you….
150.50.1.0 /24
150.50.2.0 /24
150.50.0.0 /16
150.50.0.0
150.50.3/16
.0 /24
150.50.4.0 /24
150.50.5.0 /24
192.168.1.0
255.255.255.0
Network Host
Network 192.168.1.0/24
Need:
As many subnets as possible, 60 hosts per
subnet
Calculating the number
subnets/hosts
192.168.1. 0 0 0 0 0 0 0 0
255.255.255. 0 0 0 0 0 0 0 0
6 host bits
Network Host
Network 192.168.1.0/24
Need:
As many subnets as possible, 60 hosts per
subnet
Calculating the number
subnets/hosts
Number of subnets
192.168.1. 0 0 0 0 0 0 0 0
255.255.255. 1 1 0 0 0 0 0 0 255.255.255.192
6 host bits
Network Host
Network 192.168.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
Calculating the number
subnets/hosts
Number of subnets
192.168.1. 0 0 0 0 0 0 0 0
255.255.255. 1 1 0 0 0 0 0 0 255.255.255.192
192.168.1. 0 0 0 0 0 0 0 0 192.168.1.0/26
192.168.1. 0 1 0 0 0 0 0 0 192.168.1.64/26
192.168.1. 1 0 0 0 0 0 0 0 192.168.1.128/26
192.168.1. 1 1 0 0 0 0 0 0 192.168.1.192/26
Number of Hosts per subnet: 6 bits, 64-2 hosts, 64 TOTAL
hosts, 62 usable hosts
Number of Subnets: 2 bits or 4 subnets
Calculating the number
subnets/hosts
192.168.1.0
255.255.255.0
Network Host
Network 192.168.1.0/24
Need:
As many subnets as possible, 12 hosts per
subnet
Calculating the number
subnets/hosts
192.168.1. 0 0 0 0 0 0 0 0
255.255.255. 0 0 0 0 0 0 0 0
4 host bits
Network Host
Network 192.168.1.0/24
Need:
As many subnets as possible, 12 hosts per
subnet
Calculating the number
subnets/hosts
Number of subnets
192.168.1. 0 0 0 0 0 0 0 0
255.255.255. 1 1 1 1 0 0 0 0 255.255.255.240
4 host bits
Network Host
Network 192.168.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
Calculating the number
subnets/hosts
192.168.1. 0 0 0 0 0 0 0 0 192.168.1.0/28
192.168.1. 0 0 0 1 0 0 0 0 192.168.1.16/28
192.168.1. 0 0 1 0 0 0 0 0 192.168.1.32/28
192.168.1. 0 0 1 1 0 0 0 0 192.168.1.48/28
New Subnet Mask:
192.168.1. 0 1 0 0 0 0 0 0 192.168.1.64/28
255.255.255.240 (/28)
192.168.1. 0 1 0 1 0 0 0 0 192.168.1.80/28 Number of Hosts per
192.168.1. 0 1 1 0 0 0 0 0 192.168.1.96/28
subnet: 4 bits, 16-2
192.168.1. 0 1 1 1 0 0 0 0 192.168.1.112/28
hosts, 16 TOTAL hosts,
14 usable hosts
192.168.1. 1 0 0 0 0 0 0 0 192.168.1.128/28
192.168.1. 1 0 0 1 0 0 0 0 192.168.1.144/28
Number of Subnets: 4
192.168.1. 1 0 1 0 0 0 0 0 192.168.1.160/28
bits or 16 subnets
192.168.1. 1 0 1 1 0 0 0 0 192.168.1.176/28
192.168.1. 1 1 0 0 0 0 0 0 192.168.1.192/28
192.168.1. 1 1 0 1 0 0 0 0 192.168.1.208/28
192.168.1. 1 1 1 0 0 0 0 0 192.168.1.224/28
192.168.1. 1 1 1 1 0 0 0 0 192.168.1.240/28
VLSM
28 to 10.3.255.240 / 28
Subnet 10.4.0.0/16, 4 more bits
are borrowed again, to create 16
subnets with a /20 mask.
– Mask allows for 2,046 host
20 to 10.4.240.0 / 20
Classless Inter-Domain Routing
(CIDR)-Supernetting
Route summarization done by CIDR
Routes are summarized with masks that are less than
that of the default classful mask (supernetting)
-Example:
172.16.0.0 / 13 is the summarized
route for the 172.16.0.0 / 16 to
172.23.0.0 / 16 classful networks
Answer:????
ICMP
Internet Control Message Protocol
RFC 792
ICMP is available for both IPv4 and IPv6.
ICMPv4 is the messaging protocol for IPv4.
ICMPv6 provides these same services for IPv6 but
includes additional functionality.
ICMP messages common to ICMPv4 and ICMPv6 include:
Host confirmation
Destination or Service Unreachable
Route redirection
Time exceeded
ICMPv6 includes additional functionality.
ICMP
Internet Control Message Protocol
Type
the type of service being provided. There’s a specific type number for each
error or informational message sent.
Code
the error code provides further information on the message type. It tells what
was the possible cause to the problem.
Checksum
the 16-bit one's complement of the one's complement sum of the ICMP
message starting with the ICMP type. Used to find problems on the ICMP
message ONLY.
ICMP Messages
8 0
Send
0 0
Reply
ICMP: Echo Request/Reply
ICMP: Echo Request/Reply
Destination or Service
Unreachable
When a router cannot deliver a packet, it sends an ICMP
Destination Unreachable message to the source.
Message includes a code indicating why it could not be
delivered.
Some of the Destination Unreachable codes for ICMPv4 are:
0 - net unreachable.
1 - host unreachable.
2 - protocol unreachable.
3 - port unreachable.
4.- fragmentation needed and DF set
5.- source route failed
Note: Codes 0,1,4 and 5 may be received from a gateway
codes 2 and 3 may be received from a host
Destination or Service
Unreachable
ICMP only reports on the status of the delivered packet to the
source device.
For example:
PC1 pings PC2.
The ping crosses R1, then R2, but R3 encounters a link error.
Since the packet only contains the source and destination IP
addresses, R3 may notify PC1 of the failure (optional).
It’s unaware of the exact path the packet took
No ICMP messages are sent to R1 or R2.
R1 R2 R3 PC2
PC1
Destination or Service
Unreachable
C:\Users\eietr> ping 192.168.2.115 Codes 0 (net
Pinging 192.168.1.115 with 32 bytes of data:
unreachable) is sent
Reply from 192.168.1.116: Destination net unreachable. when a router does not
Reply from 192.168.1.116: Destination net unreachable. have the requested
Reply from 192.168.1.116: Destination net unreachable. network.
Reply from 192.168.1.116: Destination net unreachable.
C:\Users\eietr>
C:\Users\eietr>
Ping Tools
www.pingtest.net
Ping Tools
Ping Tools - IPERF