Problems on subnetting
1. What is the last valid host on subnet 192.168.15.40/25
2. Which subnet does host 192.168.193.125/26 belong to?
3. We have a subnet 10.1.1.0/24 this subnet is divided into 5 other subnets; the
first one is 4 times of any other subnets. Find the 5 subnets.
4. A company has bought 173.15.0.0/16 public address block from SP, segment
this block so it can fit the company needs based on their number of networks
= 15 Networks.
5. A company has bought 11.0.0.0/8 public address block from SP, segment this
block so it can fit the company needs based on their number of networks =
148 Networks and what is the BC address of the third subnet.
6. A company has bought 193.0.0.0/24 public address block from SP, segment
this block so it can fit the company needs based on their number of networks
= 16 Networks.
7. A company has bought 173.15.0.0/16 public address block from SP, segment
this block so it can fit the company needs based on their number of hosts =
156 host.
8. A company has bought 193.0.0.0/24 public address block from SP, segment
this block so it can fit the company needs based on their number of hosts =
20 host.
9. A network administrator is asked to configure 113 point to point links which
IP address scheme best defines the address range and subnet mask that meet
the requirements and waste the lowest subnets and host addresses and
calculate the losses in IPs.
a) 10.10.0.0/18 subnetted with mask 255.255.255.252
b) 10.10.0.0/25 subnetted with mask 255.255.255.252
c) 10.10.0.0/24 subnetted with mask 255.255.255.252
d) 10.10.0.0/23 subnetted with mask 255.255.255.252
e) 10.10.0.0/16 subnetted with mask 255.255.255.252
10. Which subnet mask would be appropriate for a network to be subnetted for
up to eight LANs with each LAN containing 5 to 26 hosts ?
a) 0.0.0.240
b) 255.255.255.252
c) 255.255.255.0
d) 255.255.255.224
e) 255.255.255.240
11. A company has bought 172.15.0.0/16 public address block from SP, segment
this block so it can fit the company needs.
12. A company has bought 11.0.0.0/22 public address block from SP, segment
this block so it can fit the company needs where the first network has 35
hosts , the second one has 100 hosts in addition to 3 WAN links.
13. With the IP address 10.0.0.0/27 what is the network IP address for subnet
number 2323?
14. Repeat question 11 with the same IP but with subnet number 5002.
OSI vs. TCP/IP
OSI model TCP/IP model
Initial preparation "choose the
L7: Application
suitable protocol (HTTP,POP3…etc)"
L6: Presentation Tags the extension of the data
(MP3,MP4,JIF…etc) in ASCII codes
Application
Responsible for:
1. Making sure your device is
ready for session
L5: Session
establishment "Checklist"
2. Gives the order for session
(establishment, control and
termination)
Responsible for :
1. Session (establishment,
control and termination).
2. Segmentation, sequencing
and error detection.
L4: Transport
Transport
*Sequence number
*Session number DATA UDP TCP
*CRC
Segment
Responsible for End to end data
delivery.
Internet/Network
*SRC IP
L3: Network Segment
*DST IP
IPV6 IPV4
Packet
The Network card.
Responsible for hop top hop delivery.
*SRC MAC Network access
L2: Data link Packet CRC
*DST MAC
Ethernet Wi-Fi
ATM DSL
X25 FR
Frame
L1 : Physical Layer
Cables
Data is sent from A to B
Frame encapsulation:
Session #
SRC MAC A SRC IP 1.1.1.1
Sequence # DATA CRC
DST MAC C DST IP 2.2.2.2
CRC
Layer 1 vs. Layer 2 devices
Layer 1 Devices Layer 2 Devices
They don’t understand neither IP address nor They understand MAC address only.
MAC address.
Repeater Hub Bridge Switch
*Used to regenerate *Multi ports *Operates by *Multi ports bridge.
the signal to cancel repeater. software *operates in hardware
the noise effect. *5arooof. *Very slow (ASICs)
*It floods bits "sends *Limited ports *Very fast.
data to all ports *learns the SRC MAC of the
except the receiving sent data and store it into
one". MAC table.
*Operates in half- *forwards the incoming
duplex. data according to it.
*Devices connected *Operates in full duplex
to it are in a single BC because of micro
domain and also segmentation.
single collision * Devices connected to it
domain. are in a single BC domain
but in a separate collision
domain.
Switch vs. Router
Switch Router
Forms MAC table by Forms routing table using
Learning checking the SRC MAC routing protocols
(RIP,OSPF…etc)
Compares DST MAC with Compares DST IP with
MAC table Routing table
*If DST MAC is Unknown or *If DST IP is Unknown, router
BC address, switch floods. drops the data.
*If DST MAC is known, *If DST IP is BC address,
switch forwards. router processes "Router is
Forwarding
the limit of BC domain".
"Sending data to the perfect
*If DST MAC is known, router
path"
forwards.
*No flooding to reduce the
probability of loops
*If router finds more than
one perfect path it uses Load
sharing concept.
How to get?!!
SRC MAC DST MAC SRC IP DST IP
*ARP (Address *Manual (static) *Manual
Resolution *Dynamic (DHCP) *Automatic (Name is
*Burnt on ROM of
Protocol), it is used *if both failed the given) : DNS
DTE's NIC
to get DST MAC by device takes an
using its IP address APIPA (169.254.X.X)
Data Terminal Equipments ( DTE ) Data Communication Equipments ( DCE )
*Devices that can be sources or destinations *Devices that provide star topology or
for data and information. provide clocking and synchronization.
*At least Layer 3 devices. *Layer 1 or 2 "Maximum"
Ex. Routers , Computers, Mobiles …etc Ex. Hub , Switch , CSU/DSU …etc
Networks topologies
Point to point Ring
Not efficient in large networks
Bus
Disadvantages:
1. To send data from PC2 to PC0
traffic must pass through PC3
"delay"
2. Two cards are used to connect
PCs with each other "more
One sends and all receive costs"
Mesh Star
A centralized device is put to connect all
neighboring devices.
The same as Ring but the delay issue is
solved.
The disadvantage here is it is very
expensive to put three cards in each
device.
Number of connections = n(n-1)/2
** Mesh and Ring topologies are commonly used in intermediate devices
connections.
IP classification
Public IPs Private IPs
Class A 1 : 126 10.x.x.x
172.16.x.x to 172.31.x.x
Class B 128 : 191
And 169.254.x.x "APIPA"
Class C 192 : 223 192.168.x.x
224 : 239
Class D "used in Multi cast
sessions"
240 : 254
Class E "used for military
applications"
0:
IP address 0.0.0.0 used as a
Last resort in stub routing
table.
127 :
Classless
IP address 127.0.0.1 used
in Loopback test.
255 :
IP address 255.255.255
used in Local BC
Port Number Application
20 , 21 FTP
22 SSH
23 TELNET
25 SMTP
53 DNS
67 , 68 DHCP
69 TFTP
80 HTTP
110 POP3
161 , 162 SNMP
443 HTTPS
520 RIP 1 ,2
Subnetting problems:
1. What is the last valid host on subnet 192.168.15.40/25
Solution
192.168.15.128
2. Which subnet does host 192.168.193.125/26 belong to?
Solution
192.168.193.64
3. We have a subnet 10.1.1.0/24 this subnet is divided into 5 other subnets;
the first one is 4 times of any other subnets. Find the 5 subnets.
Solution
#of total IPs = 28 = 256 IP
Let the number of IPs for subnet 2,3,4 and 5 = X
256 = 4X + X + X + X + X
X = 32 IP
# of IPs for subnet 1 = 4*32 = 128 IP
# of IPs for subnet 2,3,4 and 5 = 32 IP
So, subnet 1 = 10.1.1.0 / 25 subnet 2 = 10.1.1.128 / 25
subnet 3 = 10.1.1.160 / 25 subnet 4 = 10.1.1.192 / 25
subnet 5 = 10.1.1.224 / 25
4. A company has bought 173.15.0.0/16 public address block from SP,
segment this block so it can fit the company needs based on their number
of networks = 15 Networks.
Solution 1
16
Total #of IPs = 2 = 65536 IP
#of IPs for each network = 65536 / 15 = 4369 IP ≈ 4096 IP per network
But 4096 = 212 = 232-20
So, / 20 is the mask for each subnet and the increment value between every
two successive subnet is 4096.
so the first subnet is 173.15.0.0/20
and to determine the second subnet we have to add 4096 to the first subnet
" which is a very tough thing "
and to know the first value of the second subnet we do the following…
4096 / 255 ≈ 16 so we have to add 16 to the third octet
So, the second subnet is 173.15.16.0/20 And the third subnet is
173.15.32.0/20 and so on until we reach 173.15.240.0/20.
Solution 2
"Easier"
We have 15 Networks
15 = 0000 1111 in binary
The busy bits are 4 bits so the Networks mask will be the old mask + the
number of busy bits so it will be /20.
/20 = 255.255.11110000.00000000
The increment value between every two successive subnets is the value of
the last one in subnet mask "the one in bold"
(10000)2 = 16 and the increment occurs in the third octet
So the subnets are:
173.15.0.0/20
173.15.16.0/20
173.15.32.0/20 and so on.
5. A company has bought 11.0.0.0/8 public address block from SP, segment
this block so it can fit the company needs based on their number of
networks = 148 Networks and what is the BC address of the third subnet.
Solution
148 = (1001 0100 )2
Busy bits are 8 bits
So, Networks mask is /16
/16 = 255.1111 1111.0.0
The last one is in the second octet so the increment will be there
The decimal value of that one is one
So the subnets will be incremented by 1
So the first subnet is 11.0.0.0/16
the second subnet is 11.1.0.0/16
the third subnet is 11.2.0.0
the fourth subnet is 11.3.0.0 and so on until we reach 11.148.0.0/16.
The BC address of the third subnet is (11.3.0.0/16) – 1 = 11.2.255.255/16
Very important note concerning the last two problems:
If the Network number is powers of 2 such as ( 2,4,8,16,32,….) we don’t
transfer the network number into binary we take Log2 (network number)
then we add the result to the main mask.
6. A company has bought 193.0.0.0/24 public address block from SP, segment
this block so it can fit the company needs based on their number of
networks = 16 Networks.
Solution
4
16 = 2 so the busy bits are 4 bits then the subnet mask is /28
/28 = 255.255.255.1111 0000
The increment is 16 so the first subnet is 193.0.0.0/28,the second subnet is
193.0.0.16/28 and so on until we reach 193.0.1.0/28.
7. A company has bought 173.15.0.0/16 public address block from SP,
segment this block so it can fit the company needs based on their number
of hosts = 156 host.
Solution
n
#of hosts = 2 – 2 = 156
So, 2n = 158 ≈ 256 IP "ceiling"
So, n = 8
So, mask = 32 – 8 = 24
Subnets :
173.15.0.0/24
173.15.1.0/24
173.15.2.0/24 and so on.
8. A company has bought 193.0.0.0/24 public address block from SP, segment
this block so it can fit the company needs based on their number of hosts =
20 host.
Solution
n
#of hosts = 2 – 2 = 20
So, 2n = 22 ≈ 32 IP "ceiling"
So, n = 5
So, mask = 32 – 5 = 27
Subnets :
193.0.0.0/27
193.0.0.32/27
193.0.0.64/27 and so on.
9. A network administrator is asked to configure 113 point to point links which
IP address scheme best defines the address range and subnet mask that
meet the requirements and waste the lowest subnets and host addresses
and calculate the losses in IPs.
f) 10.10.0.0/18 subnetted with mask 255.255.255.252
g) 10.10.0.0/25 subnetted with mask 255.255.255.252
h) 10.10.0.0/24 subnetted with mask 255.255.255.252
i) 10.10.0.0/23 subnetted with mask 255.255.255.252
j) 10.10.0.0/16 subnetted with mask 255.255.255.252
Solution
The mask is 255.255.255.252 which gives 4 IPs per each network (each
link)
So the 113 links gives 4*113 IPs = 452 IP ≈ 512 IP
2n = 512
n=9
so the mask is 32 – 9 = 23
Number d is the correct answer.
To calculate the IP losses:
Losses = 512 – 452 = 60 IP
10. Which subnet mask would be appropriate for a network to be subnetted for
up to eight LANs with each LAN containing 5 to 26 hosts ?
f) 0.0.0.240
g) 255.255.255.252
h) 255.255.255.0
i) 255.255.255.224
j) 255.255.255.240
We configure for the maximum range ( 26 hosts + 2 ) = 28 host ≈ 32 host
N=5
Mask = 32 – 5 = /27 = 255.255.255.224
Number d is the correct answer.
11. A company has bought 172.15.0.0/16 public address block from SP,
segment this block so it can fit the company needs.
Solution
First we start with the largest subnetwork (220 hosts)
220 ≈ 256 host = 28
So N = 8 and the mask is /(32-8) = /24
So the first subnet is 172.15.0.0/24
Similarly the other subnets are 172.15.1.0/27 , 172.15.1.32/27
12. A company has bought 11.0.0.0/22 public address block from SP, segment
this block so it can fit the company needs where the first network has 35
hosts , the second one has 100 hosts in addition to 3 WAN links.
Solution
Starting with the largest network…
100 ≈ 128 host = 27
So N = 7 and the mask is /(32-7) = /25
So the first subnet is 11.0.0.0/25
For the second subnet (35 hosts)…
35 ≈ 64 host = 26
So N = 6 and the mask is /(32-6) = /26
So the second subnet is 11.0.0.128/26
For the three WAN links…
Each link should have 4 IPs (2 for each port + BC IP + Network name)
So the three WAN links are subnetted to :
11.0.0.192/30 , 11.0.0.196/30 and 11.0.0.200/30
13. With the IP address 10.0.0.0/27 what is the network IP address for subnet
number 2323 ?
Solution
IP address 10.0.0.0 /27 gives 32 IP per subnet
Our target is subnet 2322 as the subnetting count starts from zero not from
one.
At subnet 2322 we counted 2322*32 IP = 74304 IP
To know the number that occupies the fourth octet we divide 74304 by 265
74304/256 = 290.25 so the we should write 290 in the fourth octet BUT the
octet cannot exceed 255 so we divide again 290.25 by 256
290.25/256 = 1.13 which is lower than 255 so the second octet is occupied
with 1
So the required subnet is 10.1.X.Y and we need to replace X , Y with the right
numbers.
To determine X we take the fraction of 1.1328 and we multiply it with 256
So X = 0.1328125 * 256 = 34
And similarly Y = 0.25 * 256 = 64
So the network name is 10.1.34.64
14. Repeat question 11 with the same IP but with subnet number 5002.
Solution
IP address 10.0.0.0/27 gives 32 IP
Total #of IPs = 5001*32 = 160032 IP
160032/256 = 625.125 > 255 so we divide again
625.125/255 = 2.44189
So Network IP is 10.2.X.Y
To determine X:
X = 0.44189 * 256 = 113
To determine Y:
Y = 0.125 * 256 = 32
So Network IP is 10.2.113.32
Initial Configurations
User Mode Router>
enable
Enable Mode Router#
Exit
Conf t
Global configurations mode Router(config)#
Basic configurations :
1. To assign a name for any router :
(config)#hostname ______
2. To assign password for LOGIN
(config)#line console 0
(config-line)#password ______
(config-line)#Login
3. To assign password for ENABLE MODE
(config)#enable password _____ (config)#enable secret _____
With strong encryption (MD5)
Without encryption
Hashed passwords
4. To encrypt all current and future passwords we use this command:
(config)#service password-encryption
But this command encrypts passwords in (type 7) which encrypts in
plain text "Easy to be cracked"
5. To check all previous configurations :
Router#show run
6. To give an IP address:
(config)#int ___
(config-if)# ip add adress mask
(config-if)#No shutdown
7. To know whether your device is DCE or not :
Router#show controller _____
8. If the device is DCE so we shoed assign a clock rate for this port
(config-if)#clockrate _____
9. To Activate Telnet protocol :
(config)#line vty 0 4
(config-line)#password _____
(config-line)#login
(config-line)#exit
10. We need to build routing table ( statically or dynamically ) but now we
are going to build it statically
(config)#Ip route ip add mask next hop address or interface
we repeat the previous command with every neighboring network.
11. To assign a last resort route
(config)#Ip route 0.0.0.0 0.0.0.0 next hop address or interface
Or
(config)#Ip default-network 0.0.0.0
12. To display CPU utilization :
#show process
13. To display RAM information :
#show run
14. To display NVRAM information :
#show start
15. To show IOS version :
#show version // also displays configurations file
Or
#show flash
16. To save configurations :
#copy run start
Or
#write
Lab 1
Initial configurations Telnet
And Static Routing
Commands :
>en
#conf t
(config)#hostname ___
(config)#banner motd $ ___$
(config)# enable secret ___
(config)#line console 0
(config-line)#password ___
(config-line)#login
(config-line)#exit
(config)#line vty 0 3
(config-line)#password ___
(config-line)#login
(config-line)#exit
#show ip int brief
(config)#int ___
(config-if)#ip add ip add mask
(config-if)#no shutdown
(config-if)#clock rate ___
(config-if)#exit
(config)#ip route IP add mask interface or next hop IP add
For troubleshooting:
#show ip route
#show cdp neighbor
#show ip int brief
#ping IP add
#Telnet IP add
Network :