0% found this document useful (0 votes)
61 views

Report 2 PDF

The document discusses IP addressing and subnetting. It explains that IP addresses have two parts: a network address and a host address. It then covers IP address classes, default subnet masks, network and host addresses, converting between decimal and binary, examples of finding network IDs and host IDs, public and private IP addresses, the process of subnetting including an example, and a guide to subnetting step-by-step.

Uploaded by

Ashik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Report 2 PDF

The document discusses IP addressing and subnetting. It explains that IP addresses have two parts: a network address and a host address. It then covers IP address classes, default subnet masks, network and host addresses, converting between decimal and binary, examples of finding network IDs and host IDs, public and private IP addresses, the process of subnetting including an example, and a guide to subnetting step-by-step.

Uploaded by

Ashik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Computer Networks

CSE 323 Handout # 1 Subnetting

IP Addressing and Subnetting


How to identify a student in a university? How to identify a PC in a network?

UIU UAP

CSE EEE BBA CSE EEE BBA

Create student ID to identify each student Create ID to identify each computer

University IP Address (Network, Host)


Department Subnet Mask
Batch # Student # Default Gateway

IP addresses are used to uniquely identify individual TCP/IP networks and hosts, such as computers and printers,
on those networks in order for devices to communicate. Workstations and servers on a TCP/IP network are called
hosts and each has a unique IP address. This address is referred to as its host address. In its basic form, the IP
address has two parts:
 A network address
 A host address
The IP address of a workstation, or host is a logical address, meaning it can be changed. The Media Access Control
(MAC) address of the workstation is a 48-bit physical address. This address is burned into the network interface
card (NIC) and cannot change unless the NIC is replaced. The combination of the logical IP address and the physical
MAC address helps route packets to their proper destination.
Review IP address classes and their characteristics
Address classes
There are five classes of IP addresses, A through E. Only the first three classes are used commercially. A Class A
network address is discussed in the Table 1 to get started. 127 is reserved for loopback testing. The first octet alone
defines the network ID for a Class A network address.
Default subnet mask
The default subnet mask uses all binary ones, decimal 255, to mask the first 8 bits of the Class A address, first 16 bits
of the Class B addresses, and first 24 bits of the Class C addresses. The default subnet mask helps routers and hosts
determine if the destination host is on this network or another one. It is common to subdivide the network into
smaller groupings called subnets by using a custom subnet mask.
Network and host address
The network or host portion of the address cannot be all ones or all zeros. As an example, the Class A address of
118.0.0.5 is a valid IP address. The network portion, or first 8 bits, which are equal to 118, is not all zeros and the host
portion, or last 24 bits, is not all zeros or all ones. If the host portion were all zeros, it would be the network address
itself. If the host portion were all ones, it would be a broadcast for the network address. The value of any octet can
never be greater than decimal 255 or binary 11111111.

Mohammad Mamun Elahi Page # 1 June 21, 2014


Computer Networks
CSE 323 Handout # 1 Subnetting

Example – IP Address

Example – Network Address

Mohammad Mamun Elahi Page # 2 June 21, 2014


Computer Networks
CSE 323 Handout # 1 Subnetting
Example – Broadcast Address
Table 1

Example:
Find the class of the following IP addresses.
a. 208.34.54.12
b. 238.34.2.1
c. 114.34.2.8
d. 129.14.6.8

Decimal-to-Binary and Binary-to-Decimal

Mohammad Mamun Elahi Page # 3 June 21, 2014


Computer Networks
CSE 323 Handout # 1 Subnetting
Example:
Convert the following numbers into binary: 201, 511, 156.

Example:
Convert the following binary numbers into decimal: 11011101, 11110111, 10001100.

Example:
Change the following IP addresses from dotted-decimal notation to binary notation.
a. 114.34.2.8
b. 129.14.6.8
c. 208.34.54.12
d. 238.34.2.1

Example:
Find the network ID and the host ID of the following IP addresses
Network id Host id
a. 114.34.2.8
b. 132.56.8.6
c. 208.34.54.12

Mohammad Mamun Elahi Page # 4 June 21, 2014


Computer Networks
CSE 323 Handout # 1 Subnetting
Public and Private IP addresses

Mohammad Mamun Elahi Page # 5 June 21, 2014


Computer Networks
CSE 323 Handout # 1 Subnetting

Subnetting:

Mohammad Mamun Elahi Page # 6 June 21, 2014


Computer Networks
CSE 323 Handout # 1 Subnetting

Subnetting Example

3. Steps

Mohammad Mamun Elahi Page # 7 June 21, 2014


Computer Networks
CSE 323 Handout # 1 Subnetting

Mohammad Mamun Elahi Page # 8 June 21, 2014


Computer Networks
CSE 323 Handout # 1 Subnetting

Example:
Write the following masks in slash notation (/n).
a. 255.255.255.0
b. 255.0.0.0
c. 255.255.224.0
d. 255.255.240.0

A Simple Algorithm for Subnetting

Suppose,
Number of network bits before subnetting = N
Number of bits borrowed (subnetting bits) = S, and
Number of host bits remaining after subnetting = H.

Then, N + S + H must be equal to 32 bits.


You can arrange the 32 bits in the following way:
N (Network Bits) S (Subnetting Bits) H (Host Bits)

If you need to find mth valid IP address in the nth subnet after subnetting, follow the
steps below:
Step 1: Write down the network part in the “N (Network Bits)” part.
Step 2: Convert “n” into binary in exactly S bits and write in the “S (Subnet Bits)” part.
Step 3: Convert “m” into binary in exactly H bits and write in the “H (Host Bits)” part.
Step 4: Group the bits from right to left “8-bits at a time” and convert to the “dotted
decimal” format.

Example:
You have the following IP 211.63.57.0, this network is subnetted by 3-bits. Find the 50th IP
address of subnet # 6.

N S H

Example:
You have the following IP 7.0.0.0, this network is subnetted by 11-bits. Find the 500th IP address
of subnet # 60.

N S H

Example:
You have the following IP 189.23.0.0, subnetted by 9-bits. Find 100th IP address of subnet # 300.

N S H
Mohammad Mamun Elahi Page # 9 June 21, 2014
Computer Networks
CSE 323 Handout # 1 Subnetting

A Step by Step Guide to Subnetting


Address 172.16.0.0/16 = default subnet 255.255.0.0 ie Class B address

16 network bits

Network Host
IP Address 10101100.00010000.00000000.00000000
Subnet Mask 11111111.11111111.00000000.00000000

You may be asked to supply 500 subnets; using the formula Subnets = 2n, Where n = no. of bits to borrow

Step 1 Step 2
n 2n
0 1
To determine the number of
From the table on the right; to 1 2
2 4
usable hosts per subnet we
obtain 500 subnets. subtract the borrowed bits (9)
3 8
4 16 from the total number of host bits
We need to borrow 9 host bits (16) which gives us 7 remaining
5 32
as subnet bits. 6 64 host bits. Using the formulae
7 128 Hosts = 2n – 2 = 27 – 2 . From
This will give us; 8 256 the table 27 = 128. Thus usable
29 = 512 subnets 9 512 hosts = 128 – 2 =126
10 1024 (Remember the first and last
(Remember you may end up 11 2048 addresses are for network and
with unused subnets) 12 4096 broadcast, hence the minus 2 in
13 8192
the formula)
14 16384
15 32768
16 65536
Step 3
Mark the borrowed bits as subnet bits
Network Subnet Host
IP Address 10101100.00010000.00000000.00000000
Subnet Mask 11111111.11111111.11111111.10000000

Remember the borrowed bits in the mask change


from 0 (zero) to 1 (one)
Step 4
Define the subnetted network;
Address 172.16.0.0/25 = subnet mask 255.255.255.128 (custom Subnet Mask)

The first 3 octets (24 bits) are network


There are now 25 network bits. bits, hence each octet = 255. The final
(16 original + 9 borrowed) octet has only the MSB (Most Significant
Bit) as a network bit, hence 128.

Mohammad Mamun Elahi Page # 10 June 21, 2014


Computer Networks
CSE 323 Handout # 1 Subnetting
Step 5: Calculate the subnet addresses and usable hosts for each subnet
Network Subnet Host
IP Address 10101100.00010000.00000000.00000000 We are only interested in this
Mask 11111111.11111111.11111111.10000000 part of the address when
calculating the subnets
00000000.00000000

For each subnet, the binary value


of the subnet bits will increment
by 1, so the first 5 subnets and
last 2 are; *See appendix

00000000.0 (zero subnet, may not be used)


First usable network 00000000.1
00000001.0
00000001.1
00000010.0
…etc.
Last usable network 11111111.0
11111111.1 (one subnet, may not be used)

Thus first usable subnet (Subnet 1) = 10101100.00010000.00000000.10000000


= 172 . 16 . 0 . 128
the first usable host (Subnet 1) = 10101100.00010000.00000000.10000001
172 . 16 . 0 . 129
the last usable host (Subnet 1) = 10101100.00010000.00000000.11111110
172 . 16 . 0 . 254
the broadcast address (Subnet 1) = 10101100.00010000.00000000.11111111
172 . 16 . 0 . 255
Thus host range (Subnet 1) =
10101100.00010000.00000000.10000001 to 10101100.00010000.00000000.11111110
172 . 16 . 0 . 129 172 . 16 . 0 . 254

Thus 2nd usable subnet (Subnet 2) = 10101100.00010000.00000001.00000000


= 172 . 16 . 1 . 0
the first usable host (Subnet 2) = 10101100.00010000.00000001.00000001
172 . 16 . 1 . 1
the last usable host (Subnet 2) = 10101100.00010000.00000001.01111110
172 . 16 . 1 . 126
the broadcast address (Subnet 2) = 10101100.00010000.00000001.01111111
172 . 16 . 1 . 127
Thus host range (Subnet 2) =
10101100.00010000.00000001.00000001 to 10101100.00010000.00000001.01111110
172 . 16 . 1 . 1 172 . 16 . 1 . 126
the host range (Subnet 3) =
10101100.00010000.00000001.10000001 to 10101100.00010000.00000001.11111110
172 . 16 . 1 . 129 172 . 16 . 1 . 254

and the host range (Subnet 4) =


10101100.00010000.00000010.00000001 to 10101100.00010000.00000010.01111110
172 . 16 . 1 . 129 172 . 16 . 1 . 126
and so on………
Mohammad Mamun Elahi Page # 11 June 21, 2014
Computer Networks
CSE 323 Handout # 1 Subnetting

Appendix

IP Value 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1


Subnet Number 256 128 64 32 16 8 4 2 1
Subnet 0( Not Used) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Subnet 1 Address 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
Subnet 1 Host 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1
Subnet 1 Host 126 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0
Subnet 1 Broadcast 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
Subnet 2 Address 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
Subnet 2 Host 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1
Subnet 2 Host 126 0 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0
Subnet 2 Broadcast 0 0 0 0 0 0 0 1 0 1 1 1 1 1 1 1
Subnet 3 Address 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0
Subnet 3 Host 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1
Subnet 3 Host 126 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0
Subnet 3 Broadcast 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
etc$.
Subnet 510 Address 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
Subnet 510 Host 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1
Subnet 510 Host 126 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0
Subnet 510 Broadcast 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
Subnet 511(Not Used) 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0

Note: Only the final two octets are shown for clarity.

Example:
An organization is granted the address block 130.56.0.0/16. The administrator wants to create 512
subnets.
a. Find the subnet mask.
b. Find the number of addresses in each subnet.
c. Find the first and last addresses in subnet 1.
d. Find the first and last addresses in subnet 512.

Example:
In a block of addresses, we know the IP address of one host is 182.44.82.16/26. What are the
network address and the broadcast address in this block?

Example:
Assume: Network: 170.60.0.0, SM: 255.255.255.128. Which of the following table is an invalid IP?
WHY?
IP Validity reason
170.60.25.1
170.60.26.127
170.60.40.139
170.60.212.212
170.60.255.190
170.60.252.16
170.60.100.63

Mohammad Mamun Elahi Page # 12 June 21, 2014

You might also like