Introduction to computer networkd #10
Download
Report
Transcript Introduction to computer networkd #10
Routing within an Organization
Subnets are a subset of the entire network
Networks can be divided into subnets
Subnets can be divided into subnets
Each subnet is treated as a separate network
Problem: Organizations have
multiple networks which are
independently managed
Solution 1: Allocate a separate
network address for each
network
▪ Difficult to manage
▪ From the outside of the
organization, each network
must be addressable.
Solution 2: Add another level of
hierarchy to the IP addressing
structure
University Network
Engineering
School
Medical
School
Library
Subnetting
A subnet can be divided into subnets
If the first layer of subnetting used 2 bits for the
subnet portion, a second layer can be used to
subnet within each subnet
▪ Using more bits from the host portion of the address
Layer 1
Layer 2
Subnet 1
Subnet 2a
Network 1
Subnet 2
Subnet 2b
Subnet 3
Given the network address 17.0.0.0, find
the class, the block, and the range of the
addresses.
Solution
The class is A because the first byte is
between 0 and 127. The block has a netid
of 17. The addresses range from 17.0.0.0 to
17.255.255.255.
Given the network address 132.21.0.0, find
the class, the block, and the range of
addresses.
Solution
The class is B, the block is 132.21, and the
range is 132.21.0.0 to 132.21.255.255
Given the network address 220.34.76.0,
find the class, the block, and the range of
addresses
Solution
The class is C, the block is 220.34.76, and the
range of addresses is 220.34.76.0 to
220.34.76.255
Given an address from a block of addresses, we can
find the network address by AND-ing with a mask.
Default masks
The network address is the beginning
address of each block. It can be found
by applying the default mask to any of
the addresses in the block (including
itself). It retains the netid of the block
and sets the hostid to zero.
Given the address 23.56.7.91, find the
beginning address (network address).
Solution
The default mask is 255.0.0.0, which means
that only the first byte is preserved and
the other 3 bytes are set to 0s. The
network address is 23.0.0.0.
Given the address 132.6.17.85, find the
beginning address (network address).
Solution
The default mask is 255.255.0.0, which
means that the first 2 bytes are preserved
and the other 2 bytes are set to 0s. The
network address is 132.6.0.0
Given the address 201.180.56.5, find the
beginning address (network address).
Solution
The default mask is 255.255.255.0, which
means that the first 3 bytes are preserved
and the last byte is set to 0. The network
address is 201.180.56.0
Class A (24 bits for hosts) 224 - 2* = 16,777,214 maximum hosts
Class B (16 bits for hosts) 216 - 2* = 65,534 maximum hosts
Class C (8 bits for hosts) 28 - 2* = 254 maximum hosts
* Subtracting
the network and broadcast reserved address
An IP address such as 176.10.0.0 that has all binary 0s in
the host bit positions is reserved for the network address.
An IP address such as 176.10.255.255 that has all binary 1s in
the host bit positions is reserved for the broadcast address.
Is the act of “borrowing” bits from the host
portion to create smaller networks (called
subnetworks)
Minimum bits that can be borrowed is 2.
Subnetting is used to reduce the number of
broadcast domains
Communication between these subnetworks is
achieved through a router
19
Determines which part of an IP address is the network
field and which part is the host field
Follow these steps to determine the subnet mask:
1. Express the subnetwork IP address in binary form.
2. Replace the network and subnet portion of the address
with all 1’s.
3. Replace the host portion of the address with all 0’s.
4. Convert the binary expression back to dotted-decimal
notation.
Subnet mask in decimal = 255.255.240.0
Imagine that you have a class "B” network. This
time however, instead of borrowing all eight
bits of the third octet, only seven bits are
borrowed to create subnetworks.
Using binary representation, in this example,
the subnet mask would be
11111111.11111111.11111110.00000000.
Therefore, 255.255.255.0 can no longer be used
as the subnet mask.
Class B address with 8 bits borrowed for the subnet
130.5.2.144 (8 bits borrowed for subnetting) routes to subnet
130.5.2.0 rather than just to network 130.5.0.0.
Class C address 197.15.22.131 with a subnet
mask of 255.255.255.224 (3 bits borrowed)
11000101 00001111 00010110 100
Network Field
SN
00011
Host
Field
The address 197.15.22.131 would be on the
subnet 197.15.22.128.
The number of lost IP addresses with a Class C network
depends on the number of bits borrowed for subnetting.
How do we determine how many bits to “borrow”
for a subnet?
Determine the number of sub networks required
Work from the MOST significant (LHS) bits of the
first octet after the network number and calculate
the number of bits needed to create the required
number of subnetworks
31
Example:
You are given a class B address and you are
required to create 1000 subnetworks.
By working from the LHS of the (first octet
after the network number) 3rd octet, calculate
the number of bits to equal or slightly exceed
1000. (ie 2x = > 1000)
This would equate to 210 or 1024-2 networks
Hence you will need to borrow 10 bits from the
host portion to create 1000 subnetworks
32
Example:
The subnetmask in this instance would be
255.255.255.192
Natural Class B netmask
11111111
11111111
10 Bits Borrowed
(subnetmask)
11111111
6 bits left
for hosts
11 000000
How many host per network can you obtain from
this addressing scheme?
33
How do we determine how many bits to
“borrow” for a subnet given the number of
hosts required?
Determine the number of hosts required
Work from the LEAST significant (RHS) bits
of the last octet and calculate the number of
bits needed to create the required number of
subnetworks.
34
Example:
You are given a class B address and you require
1000 nodes per subnet
By working from the RHS (last octet) of the 4th
octet, calculate the number of bits to equal or
slightly exceed 1000. (ie 2x = > 1000)
This would equate to 210 or 1024-2 networks
Hence you will need to borrow 6 bits from the
host portion to create subnetworks with 1000
hosts each
35
Example:
The subnetmask in this instance would be
255.255.252.0
6 Bits Borrowed 10 bits required
Natural Class B netmask (subnetmask)
for hosts
11111111
11111111
111111 00 00000000
How many subnetworks per network can you
obtain from this addressing scheme?
36
Given an IP address, you will usually be given
a net/subnetmask
If you are given the mask
Subtract the mask from 256
This is known as the multiplier
The first number in each multiplier value is the
network number
The broadcast address is the next multiplier value
subtract 1
37
E.g. given the IP address 192.168.0.100 with
the subnet mask of 255.255.255.240
Or 192.168.0.100/28
What is the network number
What is the broadcast address
What are the valid IP hosts for the subnet
38
Subtract 256 from the netmask
256 - 240 = 16
This is the multiplier ie the networks are in steps of
16 (16,32,48,64,96,112 etc)
The IP address 192.168.0.100 is in the range of
|100 / 16| which is the 6 th subnetwork
The network address is 16* 6 = 96 (01100000b)
The Broadcast address is 96 + 16 - 1
=> 192.168.0.111 (01101111b)
ie (next multiplier – 1)
39
Network Portion
IP address
192.168.0.100
Netmask
255.255.255.240
SN
Host
portion
11000000 10101000 00000000
0110 0100
11111111 11111111 11111111
1111 0000
Network Address
11000000 10101000 00000000
192.168.0.96
Broadcast Address
11000000 10101000 00000000
192.168.0.111
0110 0000
0110 1111
40
Valid ranges are
192.168.0.97 to 192.168.0.110
Number of allowable hosts 97 to 110 (incl) = 14 or [24]16
- 2 = 14
▪ Remember you cannot use the first address (network
address) and the last address (broadcast address) in
the range
The number of allowable networks
[24]16 - 2 = 14 ( ie 4 bits used. If a class B address with
the last bit subnet, then add another 8 bits to give you
212 –2 allowable subnet)
41
What if the IP range goes over 2 octets
Use the same principal
Remember octets with all 0’s are considered “boring” and
will be assigned the mask of 0
You will then have to locate the position in the address with
both 1’s and 0’s (interesting byte) and use the same
algorithm
Similarly all 1’s are also considered boring and will be
given the mask of 255 (e.g. subnetting the last byte of a
class B address)
42
Example
Organization address
131.181.112.0/22
Netmask expanded : 255.255.252.0
Last byte is “not interesting” hence we set it to “0” for
network and “1” for broadcast
The third byte is “interesting”
256 – 252 = 4 (multiplier)
Networks are in increments of 4 steps
112/4 = 28 (the 28th subnetwork). Since there is no
remainder, it is the beginning of the network address.
43
Assignable addresses in
Network address :
131.181.112.0
this subnetwork
Netmask :
131.181.112.1 –
255.255.252.0
131.181.115.254
Broadcast :
Remember, the 1st and
112 + 4 – 1 = 115
last addresses cannot be
=>131.181.115.255
used (Network and
Number of valid hosts :
broadcast).
210 –2 = 1024 – 2 = 1022 hosts
Number of subnetworks available for this network
26 – 2 = 64 –2 =62 subnetworks
44
Let's assume that a device on another network with
an IP address of 197.15.22.44 wants to send data to
another device attached to Cisco's network with an IP
address of 131.108.2.2.
The data is sent out over the Internet until it reaches
the router that is attached to Cisco's network.
The router's job is to determine which one of Cisco's
subnetworks the data should be routed to.
45
46
when the router performs this ”AND-ing" operation, the host portion
falls through.
47
The router looks at what is left which is the network number
including the subnetwork.
48
The router then looks in its routing table and tries to match the
network number including the subnet with an interface.
49
Imagine that you have a class "B” network with the
network number 172.16.0.0.
After assessing the needs of his network, the network
administrator has decided to borrow eight bits in order
to create subnetworks.
When eight bits are borrowed to create subnets, the
subnet mask is 255.255.255.0.
Someone outside the network sends data to the IP
address 172.16.2.120.
50
51
52
What is the subnetwork address if the destination address is
200.45.34.56 and the subnet mask is 255.255.240.0?
Solution
We apply the AND operation on the address and the subnet
mask.
Address
➡ 11001000 00101101 00100010 00111000
Subnet Mask ➡ 11111111 11111111 11110000 00000000
Subnetwork Address ➡ 11001000 00101101 00100000 00000000.
or 200.45.32.0
53
You are given an IP address for a host 172.168.35.10/20
What is/are the
Subnet address?
Broadcast address?
The number of useable hosts available for this subnet?
The number of useable subnets available for this
network?
The assignable address range for this subnet?
54
Your organisation has been assigned a class B IP address
of 130.10.0.0
You require about 2000 subnetworks
Work out the
Subnet mask required for this subnet
The network and broadcast addresses for the first 5
useable subnets
The number of hosts for each subnet
The assignable address range of the first 5 useable
subnets
55