Title: SUBNET
1SUBNET ROUTING
2IP Addressing
3IP addressing
- Introduction to IP addressing
- Classes of IP addressing
- Why Subnet Masks are necessary?
- How to create subnet masks
4Why are IP addresses written as bits?
- In order for data to pass along the media, it
must first be changed to electrical impulses. - When a computer receives these electrical
impulses, it recognizes two things the presence
of voltage on the wire or the absence of voltage
on the wire.
5(No Transcript)
6What format do IP addresses use?
7How are IP addresses expressed in dotted notation?
8Why are IP addresses necessary?
- IP addressing makes it possible for data passing
over the network media of the Internet to find
its destination. - Because each IP address is a 32-bit value, that
means that there are four billion different IP
address possibilities. - IP addresses are hierarchical addresses like
phone numbers and zip codes.
9How do IP addresses make it possible for data
sent via the Internet to find its destination?
- It is because each network connected to the
Internet has a unique network number. - To ensure that each network number on the
Internet will always be unique and unlike that of
any other number, an organization called the
International Network Information Center, or
InterNIC
10How do IP addresses incorporate network
addresses?
- Every IP address has two parts. These are known
as the network number and the host number.
11What are the different classes of networks?
- There are three classes of IP addresses that a
company can receive from the InterNIC. The
InterNIC reserves class "A" IP addresses for
governments throughout the world, class "B" IP
addresses for medium size companies, and class
"C"
12IP addressing
1 Byte
1 Byte
1 Byte
1 Byte
Class A
Class B
Class C
Network number assigned by NICHost number
assigned by Systems Administrator
13IP addressing
1
2 - 8
9 32 (24 bits)
Bit
Class A
Class A address range1.0.0.0 126.0.0.0
(127.0.0.0 is for loopback)Private Class A
address 10.0.0.0Number of hosts 224 -2
16,777,214
14IP addressing
1
3 - 16
17 32 (16 bits)
2
Bit
Class B
Class B address range128.0.0.0
191.255.0.0Private Class B 172.16.0.0
172.31.0.0 Number of hosts 216 - 2 65,534
15IP addressing
1
4 - 24
25 32 (8 bits)
2
3
Bit
Class C
Class C address range192.0.0.0
233.255.255.0Private Class C 192.168.0.0
Number of hosts 28 - 2 254
16(No Transcript)
17How many classes of Networks are there?
- you have learned about three classes of networks
that can be assigned by the InterNIC. - In fact, there are five classes of networks.
However, only three of these are used
commercially.
18What IP addresses are reserved for multicast
purposes and experimental purposes?
- The highest number listed was 223. You may have
wondered why the highest value was only 223 and
not 255, since there are 255 possible values for
an octet. - in IP addresses the values 224 through 255 are
not used in the first octet for networking
purposes.
19What IP addresses are reserved for the Networks?
- By convention, in IP addressing schemes, any IP
address that ends in all binary zeroes is
reserved for the networkaddress. - Thus, in a class "A" network, 113.0.0.0 would be
the IP address of that network. Routers use a
network's IP address when forwarding data on the
Internet.
20(No Transcript)
21What IP addresses are reserved for broadcasts?
- for the network that is 176.10.0.0, the broadcast
address that would be sent out to all devices on
that network would be 176.10.255.255.
22Who assigns subnet addresses?
- As with the host number portion of class "A,"
class "B," and class "C addresses, subnet
addresses are assigned locally. - Usually this is done by the network administrator.
23(No Transcript)
24IP addressing Subnet mask
IP address
Netmask
Network Address
25IP addressing - Subnetting
- Subnetting
- Is the act of borrowing bits from the host
portion to create smaller networks (called
subnetworks) - Minimum bits that can be borrowed is 2 - why?
- Subnetting is used to reduce the number of
broadcast domains - Communication between these subnetworks is
achieved through a router
26(No Transcript)
27How are subnet addresses concealed from outside
networks?
- Subnets are hidden from outside networks by using
a mask. - These are referred to as subnet masks.
- The function of a subnet mask is to tell devices
which part of an address is the network number
including the subnet, and which part is the host.
28What format do subnet masks use?
- Subnet masks use the same format as IP
addressing. - In other words, they are thirty two bits long and
divided into four octets. - Subnet masks have all 1s in the network and
subnetwork portion, and all 0s in the host
portion.
29(No Transcript)
30(No Transcript)
31How many bits can be borrowed from the host
number in class "B" and class "C" networks to
create subnets?
- Because there are only two octets in the host
field of a class "B network, up to fourteen bits
can be borrowed to create subnetworks. - A class "C" network has only one octet in the
host field. Therefore, only up to six bits can be
borrowed in class "C networks to create
subnetworks.
32What happens to the subnet mask address if only
some of the bits in an octet are borrowed?
- 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.00
000000. - Therefore, 255.255.255.0 can no longer be used as
the subnet mask.
33If only seven bits are borrowed in a class "B"
network, what would the subnet mask be in dotted
decimal notation?
- HINT To convert any eight bit binary number into
a decimal number, total the powers of 2 that
occur in the number.
34What determines how many subnetworks can be
created by borrowing bits from the host field?
- Can you figure out all of the possible
combinations of 0s and 1s if four bits are
borrowed from the host field to create
subnetworks? - 16 from 0000 to 1111. However, you know that 1111
is reserved for broadcast and 0000 means this
network.
35How many subnetworks can be created by borrowing
five bits from the host field?
- Answer Thirty-two subnetworks or 25 32
subnetworks can be created by borrowing five
bits from the host field.
36Which numbers in a subnetwork are reserved for
broadcasts?
- In previous section, we used an example of a
class "C" network in which three bits are
borrowed from the host field. You learned that
when three bits are borrowed from the host octet,
up to eight subnetworks can be created each
having up to thirty-two hosts. - You also learned that IP addresses ending in all
binary 1s are reserved for broadcasts. The same
is true for subnetworks.
37For IP address 197.15.22.160 on the same class
"C network. How would this be expressed in a
binary numbering scheme?
- Answer If 197.15.22.160 is converted to binary
format, it becomes 110001010.00001111.00010110.
10100000. - The first three bits in the last octet, 101,
indicate that this is the sixth subnetwork. As
before the remaining bits are all binary 0s. This
means that the IP address197.15.22.160 must be
one that is reserved for a subnetwork address.
38Subnet mask
- 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
39Subnet mask
- 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 gt 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
40Subnet mask
- Example
- The subnetmask in this instance would
be255.255.255.192 - How many host per network can you obtain from
this addressing scheme?
6 bits left for hosts
10 Bits Borrowed (subnetmask)
Natural Class B netmask
41Subnet mask
- 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
42Subnet mask
- 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 gt 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
43Subnet mask
- Example
- The subnetmask in this instance would
be255.255.252.0 - How many subnetworks per network can you obtain
from this addressing scheme? - Note Do you recognise this address as the
student supernet address?
10 bits required for hosts
6 Bits Borrowed (subnetmask)
Natural Class B netmask
44What about a Supernet?
- A supernet borrows bits from the network
portion to create contiguous nodes to form a
super network - For example
- Company A has about 1000 nodes to address. A
class B address would be too big (or may not be
available). Solution Supernetting using 4
contiguous class C addresses203.10.112.0203.10.
113.0203.10.114.0203.10.115.0 - (All netmasked to 255.255.255.0)
45What about a Supernet?
- By allowing the first 2 bits of the third octet
to be borrowed, a virtual class B address can
be created. - A supernet address of 203.10.112.0
203.10.115.255 is formed with a subnet mask of
255.255.252.0. - The Host portion will be expanded from 8 10
bits - Route summarisation can occur to 203.10.112.0/22
46What about a Supernet?
Host portion
Network Portion
203.10.112.0
203.10.113.0
203.10.114.0
203.10.115.255
255.255.252.0
We have expanded the host portion by 2 bits to 10
bits
47What is a Broadcast Address
- A broadcast address is used to by a node to
communicate with ALL nodes in a broadcast domain - Like the netmask, the broadcast address is AND
with the network address. - However, the host portion of the network is
identified in a broadcast address
48What is a Broadcast Address
- A broadcast address does this by inserting all
1s in the host portion. - Eg A natural class B broadcast address would look
something like this - N.N.255.255
- If it is not a classful subnetmask, you can
determine the broadcast address within each
subnet by locating the host portion and setting
them to all 1s.
49What is a Broadcast Address
- An example of a Broadcast address
50What is a Broadcast Address
- An example of a cross boundary subnet broadcast
address with a mask of 255.255.252.0
Host portion
Network Portion
SN
Network Address
Host
Broadcast Address
51What is a Broadcast Address
- An example of a cross boundary subnet broadcast
address with a mask of 255.255.252.0 - In this example, IP addresses
- 131.181.112.0 131.181.115.255 belong to the
same subnetwork
Host portion
Network Portion
SN
131.181.112.0(Network)
131.181.113.0
131.181.114.0
131.181.115.255(Broadacast)
52Network Address VS Broadcast address
- Remember
- A Network address has all the host bits set to
0 - A Broadcast address has all the host bits set to
1 - Therefore
- 131.181.112.0 is the network address
- 131.181.115.255 is the broadcast address
53Network Address VS Broadcast address
- This is important when you are doing ifconfig and
routing commands - For example, if a host has an address
131.181.114.10/22 - The ifconfig route commands would be
- ifconfig ethltxgt inet 131.181.114.10 netmask
255.255.252.0 broadcast 131.181.115.255 - route add net 131.181.112.0 netmask
255.255.252.0 dev ethltxgt
54How do you determine Network and Broadcast
address quickly?
- There are different subnetting exercises
- Given an IP address mask,
- What is the network/subnetwork address
- What is the network/subnetwork broadcast address
- What are the assignable address in that
network/subnetwork - What are all the valid subnet addresses
- How many nodes per subnet
55Algorithm for deriving Subnet information
- 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
56Algorithm for deriving Subnet information
- Eg 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
57Algorithm for deriving Subnet information
- 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 gt
192.168.0.111 (01101111b) - ie (next multiplier 1)
Host portion
Subnetwork portion
58Algorithm for deriving Subnet information
Host portion
Network Portion
SN
IP address192.168.0.100
Netmask 255.255.255.240
Network Address192.168.0.96
Broadcast Address192.168.0.111
59Algorithm for deriving Subnet information
- Valid ranges are
- 192.168.0.97 to 192.168.0.110
- Number of allowable hosts 97 to 110 (incl) 14
or 2416 - 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
- 2416 - 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)
60Algorithm for deriving Subnet information
- What if the IP range goes over 2 octets
- Use the same principal
- Remember octets with all 0s are considered
boring and will be assigned the mask of 0 - You will then have to locate the position in the
address with both 1s and 0s (interesting byte)
and use the same algorithm - Similarly all 1s are also considered boring and
will be given the mask of 255 (eg subnetting the
last byte of a class B address)
61Algorithm for deriving Subnet information
- Example
- QUT students supernet 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
62Algorithm for deriving Subnet information
- Assignable addresses in this subnetwork131.181.11
2.1 131.181.115.254 - Remember, the 1st and last addresses cannot be
used (Network and broadcast)
- Network address 131.181.112.0
- Netmask 255.255.252.0
- Broadcast 112 4 1 115 gt131.181.115.255
- Number of valid hosts 210 2 1024 2 1022
hosts - Number of subnetworks available for this
network26 2 64 2 62 subnetworks
63How does the router handle IP addresses and
subnet masks?
- 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.
64(No Transcript)
65when the router performs this ANDing" operation,
the host portion falls through.
66The router looks at what is left which is the
network number including the subnetwork.
67The router then looks in its routing table and
tries to match the network number including the
subnet with an interface.
68How does the "Anding operation change with
different subnet masks?
- 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.
69(No Transcript)
70(No Transcript)
71Exercise
- Exercise
- You are given an IP address for a
host172.168.35.10/20 - What is/are the
- 1. Subnet address?
- 2. Broadcast address?
- 3. The number of useable hosts available for
this subnet? - 4. The number of useable subnets available
for this network? - 5. The assignable address range for this
subnet? - Answers
72Exercise
- Exercise
- Your organisation has been assigned a class B IP
address of 130.10.0.0 - You require about 2000 subnetworks
- Work out the
- 1. Subnet mask required for this subnet
- 2. The network and broadcast addresses for
the first 5 useable subnets - 3. The number of hosts for each subnet
- 4. The assignable address range of the first
5 useable subnets - Answers
73ROUTING
74Routing
- Routing describes a process where packets are
forwarded from one network to another. - Routing can be performed by devices such as
- dedicated routers
- servers with more than one network interface
multihomed hosts - switches incorporating a route function.
75Routers
- Routing devices typically have more than one
network interface, each called a port. - Routers process datagrams individually, making
routing a processing-intensive operation. - Dedicated routers offer better performance
characteristics compared with multi-homed hosts.
76Routing Tables
- To determining the proper destination network for
datagrams, routers consult an internal table. - The table consists of records, one per line, each
representing a known network. - Each record includes a set of associated
characteristics such as netmask
77Building Route Tables.
- Routing table entries can be built by two
methods - Static entries are entered manually by a network
administrator - Dynamic entries are entered dynamically by
routing protocols. Routers learn destination
network addresses by the periodic exchange of
route tables between routing devices. Routing
protocols use IP to deliver this information.
78Configuring Routers
- Before IP routers can perform the route function
and use routing protocols to exchange route
tables, each interface (port) must be correctly
numbered with a valid host IP address and
netmask. - The IP address must be selected from within the
range for the particular network address.
Typically local gateways are located the first
address in the valid host range.
79Routing Protocols
- Routing protocols are used by routers to
- learn the location of destination networks.
- determine the best route to reach networks.
- Examples of routing protocols include
- RIP, Routing Information Protocol
- OSPF, Open Shortest Path First
- BGP, Border Gateway Protocol
80Routing Protocols - 2
- Routing protocols differ in
- the way in which they exchange route tables
- determine the route to the destination
- the information that is communicated
81Distance Vector
- Distance Vector routing protocols broadcast the
entire route table on a regular basis. RIP2
typically defaults at once every 30 seconds.This
creates considerable network traffic. - They determine the best route path on the basis
of the least number number of hops to reach a
destination network.
82Link State
- Link state protocols only broadcast changes to
route information after an initial entire table
has been sent. - When determining the best path, other factors
such as policies (e.g. preferred path) and cost
( time taken, available bandwidth) can influence
the choice when multiple paths are available.
83IP Routing
- Before a routing device can forward an IP
datagram it must - examine the Destination Address in the datagram
- use the netmask to identify the network portion
of the packets destination address - find a corresponding network address in the route
table and forward the packet to the gateway or
interface specified
84Route Table Fields
- To forward IP datagrams, the router uses the
following fields of the the route table - Destination
- Network Mask
- Gateway
85Destination
- This field lists the networks which are known to
the router. Addresses may have been entered by an
administrator, or dynamically learned from the
transmissions of other routers. - Address entries concerned with routing between
network addresses will be of the format
ltnetidgt, 0
86Netmask
- The netmask field provides the router with the
ability to determine the network address of
packets being examined. - A logical AND is performed using the netmask and
the destination address. This logically removes
the host portion allowing the router to identify
the destination
87Gateway
- The Gateway field lists the IP addresses of the
interface where the datagram should be sent
(forwarded) to reach the specified Destination. - This field may contain
- An IP interface address corresponding to an
adjacent router - 0.0.0.0
- The address of a interface
88Destination Hop0.0.0.0
- A Destination of 0.0.0.0 indicates a directly
connected network. Hosts located on this network
can be reached using the local network method. If
the network is Ethernet, the ARP protocol is used
to find the physical address of the node.