//Ping Machines On Multiple Subnets

Ping Machines On Multiple Subnets


All the hosts in a network must have the same network number. This property of IP addressing can cause problems as networks grow. For example, consider a university that started out with one class B network used by the Computer Science Dept. for the computers on its Ethernet. A year later, the Electrical Engineering Dept. wanted to get on the Internet, so they bought a repeater to extend the CS Ethernet to their building.

As time went on, many other departments acquired computers and the limit of four repeaters per Ethernet was quickly reached. A different organization was required. Getting a second network address would be hard to do since network addresses are scarce and the university already had enough addresses for over 60,000 hosts. The problem is the rule that a single class A, B, or C address refers to one network, not to a collection of LANs. As more and more organizations ran into this situation, a small change was made to the addressing system to deal with it. The solution is to allow a network to be split into several parts for internal use but still act like a single network to the outside world.

In the Internet literature, the parts of the network are called subnets. When a packet comes into the main router, how does it know which subnet (Ethernet) to give it to? One way would be to have a table with 65,536 entries in the main router telling which router to use for each host on campus. This idea would work, but it would require a very large table in the main router and a lot of manual maintenance as hosts were added, moved, or taken out of service.

Instead, a different scheme was invented. Basically, instead of having a single class B address with 14 bits for the network number and 16 bits for the host number, some bits are taken away from the host number to create a subnet number. For example, if the university has 35 departments, it could use a 6- bit subnet number and a 10-bit host number, allowing for up to 64 Ethernets, each with a maximum of 1022 hosts (0 and -1 are not available, as mentioned earlier). This split could be changed later if it turns out to be the wrong one. To implement subnetting, the main router needs a subnet mask that indicates the split between network + subnet number and host


Assignment 2 PL-4 (192-223 Class C IP)

IP Address Classes:
Class A: 0-126
Class B: 127-191
Class C: 192-223
Class D: 224-255

If Subnet mask is it means Class A. That is, first 8 bits are 1. This also means that 2 raised to 8 is IP and 2 raised to 24 - 2(2 reserved always) is number of Hosts (machines that can be added).

Consider Netmask as Then we can AND with the IP address to check if it is in the same subnet (i.e. both IP should match).
So, is different subnet than

You can use free Cisco Tracer tool to setup networks and clear doubts. Designing for this assignment will include 2 or more machines connected to a switch and the switch is connected to a router.
The switch needs to be enabled by running command 'enable'. The machines need to be setup with static IP addresses. The machines on other side of router will be of different subnet.


First manually go to Edit Connections...
IPv4 settings
Choose Manual
Input IP address as needed (e.g. and Netmask as:
Click on Ethernet Connection Name to reset (Disconnect & Connect)


import os

os.system("ping -c 2")
os.system("sudo route add -net netmask eth6")
os.system("ping -c 2")

By |2017-01-10T00:23:26+00:00January 10th, 2017|Categories: Tech|0 Comments

About the Author:

Pratik Kataria is currently learning Springboot and Hibernate. Technologies known and worked on: C/C++, Java, Python, JavaScript, HTML, CSS, Wordpress, Angular, Ionic, MongoDB, SQL and Android. Softwares known and worked on: Adobe Photoshop, Adobe Illustrator and Adobe After Effects.

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.