Report 2 PDF
Report 2 PDF
UIU UAP
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.
Example – IP Address
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
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
Subnetting:
Subnetting Example
3. Steps
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
Suppose,
Number of network bits before subnetting = N
Number of bits borrowed (subnetting bits) = S, and
Number of host bits remaining after subnetting = H.
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
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
Appendix
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