IPv4 Addresses 2

Download Report

Transcript IPv4 Addresses 2

Lecture #2
C
S
Chapter 5: Addressing (Part 2 of 3)
4
5
0
0
Dr. Clincy
Lecture
1
Multihomed devices
C
S
• As we mentioned, any device with one or more connections to the
Internet will need an IP address for EACH connection – such
devices are called “multihomed” devices.
• A Router could be a multihomed device
4
5
0
0
Dr. Clincy
Lecture
2
Example of direct broadcast address
Router sending to all hosts on a
network
C
S
If the hostid is all 1’s, it’s called a
“broadcast address” and the router
use it to send a packet to all host
in a specific network. In this case,
hosts 20, 64, 126 and etc. will
receive the packet from the router
4 Example of limited broadcast address
Host sending to all other hosts
5
on a network
0
If the hostid and netid are all 1’s,
it’s called a “limited broadcast
address”. If the host wants to send
0
a packet to all host in a specific
network, it would use this address.
The router would block this
address so that data stays
contained within a specific
network.
Dr. Clincy
Lecture
3
Example of this host on this address
IP-less Host sending message
to bootstrap server
C
S
4
5
0
0
An address of all 0’s is used
during bootstrap time if the host
doesn’t know it’s IP address. The
un-named host sends an all 0
source address and limited
broadcast (all 1’s) destination
address to the bootstrap server.
Example of specific host on this network
Host sending to some other specific
host on a network
An address with a netid of all 0’s
is used by a host or router to send
another host with in the same
network a message.
Dr. Clincy
Lecture
4
Example of loopback address
• The IP address with the 1st byte equal to 127 is used for the loop back address.
C
S
• Loopback address is used to test software on a machine – the packet never leaves the
machine – it returns to the protocol software
• Example: a “ping” command can send a packet with a loopback address as the destination
address to see if the IP software is capable of receiving and processing a packet.
4
5
0
0
Dr. Clincy
Lecture
5
Sample internet
Ethernet
C
S
4
5
0
0
ATM
Token Ring
Ethernet
Dr. Clincy
Lecture
6
Chapter 5
C
S
Subnetting
4
5
0
0
Dr. Clincy
Lecture
7
SUBNETTING
C
S
4
5
0
0
• When we talked about CLASSFUL addressing – we
realized the problem of wasted host addresses and
depleting available network addresses.
• In subnetting, a network is divided into several smaller
networks called subnetworks or subnets – each subnet
will have it’s own address
• Typically, there are 2 steps in reaching a destination: first
we must reach the network (netid) and then we reach the
destination (hostid)
Dr. Clincy
Lecture
8
A network with two levels of
hierarchy (not subnetted)
C
S
4
5
0
0
The 2 level approach is not enough some times – you can
only have 1 physical network – in example, all host are at
the same level – no grouping
Dr. Clincy
Lecture
9
A network with three levels of
hierarchy (subnetted)
C
S
(0-63)
4
5
0
0
(64-127)
With
subnetting,
hosts can be
grouped
(128-191)
(192-255)
Dr. Clincy
Lecture
10
Addresses in a network with
and without subnetting
C
S
4
5
0
0
With subnetting, there are 3 levels (versus 2 levels).
Partition the hostid space into subnetid and hostid.
(1st) network, (2nd) subnetwork and (3rd) host
Dr. Clincy
Lecture
11
Similar to Hierarchy concept in a
telephone number
C
S
4
5
0
0
Dr. Clincy
Lecture
12
Default mask and subnet mask
C
S
4
5
0
0
Dr. Clincy
Lecture
13
Finding the Subnet Address
C
S
Given an IP address, we can find the subnet address the same way we
found the network address in the previous chapter. We apply the mask to
the address. We can do this in two ways: straight or short-cut.
Straight Method
4
5
0
0
In the straight method, we use binary notation for both the address and
the mask and then apply the AND operation to find the subnet address.
Short-Cut Method
** If the byte in the mask is 255, copy the byte in the address.
** If the byte in the mask is 0, replace the byte in the address with 0.
** If the byte in the mask is neither 255 nor 0, we write the mask and
the address in binary and apply the AND operation.
Dr. Clincy
Lecture
14
Subnet Mask Form
C • In the early days, non-contiguous 1’s
masks were used (0’s and 1’s could
S
alternate)
• Today, as a best practice, contiguous 1’s
4
masks are used
5 • In either case, the black box can perform
0
the “masking” process
0
Dr. Clincy
Lecture
15
Example 1
What
is
the
subnetwork
address
if
the
C
destination
address
is
200.45.34.56
and
the
S
subnet mask is 255.255.240.0?
Solution
4 11001000 00101101 00100010 00111000
5
11111111 11111111 11110000 00000000
0
0 11001000 00101101 00100000 00000000
The subnetwork address is 200.45.32.0.
Dr. Clincy
Lecture
16
Recall - 5-bit Address Space Illustration
C
S
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1-bit Netid case (no subnets)
16 addresses/block
Number of blocks: 2
4
5
0
0
Address range per block: 0 to 15
Netids: 0, 1
Network Addresses : 00000, 10000
Broadcast Addresses: 01111, 11111
Dr. Clincy
Lecture
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
17
5-bit Address Space Illustration
subnet
C
S
1-bit Subnet case
Number of blocks/networks: 2
Number subnets per block: 2
4
5
0
0
8 addresses/subnet
Address range per subnet: 0 to 7
Subnet ids: 0, 1
Network Addresses : 00000, 01000, 10000, 11000
Broadcast Addresses: 00111, 01111, 10111, 11111
Dr. Clincy
Lecture
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
18
5-bit Address Space Illustration
subnet
C
S
2-bit Subnet case
Number of blocks/networks: 2
Number subnets per block: 4
4
5
0
0
4 addresses/subnet
Address range per subnet: 0 to 3
Subnet ids: 00, 01, 10, 11
Network Addresses : 00000, 00100, 01000, 01100
10000, 10100, 11000, 11100
Broadcast Addresses: 00011, 00111, 01011, 01111
10011, 10111, 11011, 11111
Dr. Clincy
Lecture
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
19
Illustrating the mask concept (1 of 3)
netid
C
S
What is the mask ? 10000
If address 11101 is masked, what is the result ?
4
5
0
0
result
address
Dr. Clincy
Lecture
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
0
0
0
0
20
Illustrating the mask concept (2 of 3)
subnet
C
S
What is the mask (subnet mask) ? 11000
If address 11101 is masked, what is the result ?
4
5
0
0
result
address
Dr. Clincy
Lecture
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
1
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
21
Illustrating the mask concept (3 of 3)
subnet
C
S
What is the mask (subnet mask) ? 11100
If address 11101 is masked, what is the result ?
4
5
0
0
result
address
Dr. Clincy
Lecture
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
22
Example 2
What is the subnetwork address if the destination
C address is 19.30.84.5 and the mask is
S 255.255.192.0?
4
5
0
0
Dr. Clincy
Lecture
23
Comparison of a default mask and
a subnet mask
C
S
4
5
0
0
A portion of the hostid space is divided between
some contiguous 1’s and 0’s
Dr. Clincy
Lecture
24
C
S
The number of subnets must be
a power of 2.
Determine the number of subnets added by looking at the number of 1s added to
the default mask and performing 2 raised to that number
4
5
0
0
For example, 23 = 8 subnets
Dr. Clincy
Lecture
25
Example 3
C A company is granted the site address
S 201.70.64.0 (class C). The company needs six
subnets. Design the subnets.
4
5
0
0
Solution
The
number
mask is 24 (class C).
of
1s
in
the
default
The company needs six subnets. This number 6 is not a power of 2. The
next number that is a power of 2 is 8 (23). We need 3 more 1s in the subnet
mask. The total number of 1s in the subnet mask is 27 (24 + 3).
The total number of 0s is 5 (32 - 27). The mask would be
Dr. Clincy
Lecture
26
Solution (Continued)
C
S
11111111 11111111 11111111 11100000
or
255.255.255.224
4
5
0
0
The number of subnets is 8.
The number of addresses in each subnet
is 25 (5 is the number of 0s) or 32.
Dr. Clincy
Lecture
27
Example 3
C
S
4
5
0
0
Dr. Clincy
Lecture
28
Example 4
C
S
Solution
A company is granted the site address 181.56.0.0
(class B). The company needs 1000 subnets. Design
the subnets.
The number of 1s in the default mask is 16 (class B).
The company needs 1000 subnets. This number is not a power of 2. The next number that is
a power of 2 is 1024 (210). We need 10 more 1s in the subnet mask.
The total number of 1s in the subnet mask is 26 (16 + 10).
The total number of 0s is 6 (32 - 26).
4
5
0
0
The mask is
11111111 11111111 11111111 11000000
or
255.255.255.192.
The number of subnets is 1024.
The number of addresses in each subnet is 26 (6 is the number of 0s) or 64.
Dr. Clincy
Lecture
29
Example 4
C
S
4
5
0
0
Subtract 63
from 255 to
get 192
Dr. Clincy
Lecture
30