The blog covers the concept of the local subnet and remote subnet and also it is important to know that, before you understand the concept of routing .first, you should understand the concept of the local subnet and remote subnet
Subnet
in short, for a subnet to exist, there will be always exactly two devices to form a point to point link and those two devices will form an individual subnet
as can be seen, from the above topology, that we have two devices VM1 and VM2 which are connected via point to point link, and let us call that link a subnet A
Similarly, the two devices VM and VM1 are connected via point to point link and we can call that link a subnet B
We call the link from VM1 to VM2 as a subnet A and from VM to VM1 as a subnet B because we know that each point to point link will form an individual subnet
Conditions for a subnet to exist
in the first place, interfaces of two devices should be interconnected via a common link
in the second place, the interfaces should be assigned an IP address such that both fall into the same network id
Example
at this time, from the above topology if we apply subnet mask value 24 on the IP address of the interface 192.168.1.2 you will get the network id 192.168.1.0
Similarly, when you apply the subnet mask value 24 on the IP address of the interface 192.168.1.1 you will get network id 192.168.1.0
If you like to apply mask value on an IP address then can use below
Same subnet
If the first condition and second condition is satisfied then we can say the device VM1 and VM2 is on the same subnet
to point out, a subnet can be local or remote to the given router
If VM wants to talk with VM1 then this can be done by L2 routing only and whenever a machine wants to communicate with other machine also if both the machines are falls in the same subnet then L2 routing is required to carry out the communication
Router VM and VM1 are in the same subnet that is subnet B there, VM can always ping IP address 192.168.4.1/24
Similarly, VM1 can always ping the IP address 192.168.4.2/24 and this ping is supported by L2 routing only
Remote subnet
on this occasion, suppose 192.168.1.0/24 is a subnet A and 192.168.4.0/24 is a subnet B from the above topology
So, we can say the subnet A is a remote subnet for the router VM
Similarly, subnet B is a remote subnet for the router VM2
But, Why?
Because router VM has no interface on which IP address and mask value are configured such that after applying the mask value on an IP address you won’t be able to obtain network id
Local subnet
for instance, router VM has a local subnet B ( from above topology)
But, Why?
Because the router VM has at least one interface on which IP address and mask value are configured such that after applying the mask value on an IP address you will be able to obtain network ID
Router | Local subnet | Remote subnet |
VM | 192.168.4.0/24(B) | 192.168.1.0/24(A) |
VM1 | 192.168.4.0/24(B) 192.168.1.0/24(A) | |
VM2 | 192.168.1.0/24(A) | 192.168.4.0/24(B) |
as can be seen, from the above table, the router VM has local subnet (B) 192.168.4.0/24 and remote subnet (A) 192.168.1.0/24
For the router VM1, both subnets 192.168.1.0/24(A) and 192.168.4.0/24(B) are local subnets and there is no remote subnet
where as, for the router VM2, 192.168.1.0(A) is a local subnet and 192.168.4.0/24(B) is a remote subnet
How to identify local subnet and remote subnet in a broadcast link
at this point, to understand how to identify local subnet and remote subnet in a broadcast link? consider below topology
to be sure, first, let us understand what is a broadcast link?
To understand broadcast link suppose it is the wire through which more than two devices are connected
Broadcast link = a subnet with n>= 2 devices in it
as can be seen, from the above topology that the machine A, B, C, D with mac addresses MA, MB, MC, MD are connected to a common link called broadcast link
in short, the router has interface 10.1.1.1/24 and 11.1.1.1/24 with mac addresses as M1 and M2
Mac address
The Mac address is an address that will be assigned by the device manufacturer and the address will be burnt in hardware so, that you can not change it also, it will be globally unique
in fact, every interface through which a device is connected will have a mac address
in reality, you can check the Mac/IP addresses of your VM router using the below command
ifconfig
to clarify, a mac address will look like something like the below address
80:A4:56:E2:5C:59
How to find the network id of the broadcast link?
in brief, to calculate the network id of the broadcast link, first, we need to take any machine which is connected to the broadcast link second, apply mask value to the IP address of the interface of the machine
So, let us choose machine A at this instant, the machine A has the interface as 11.1.1.2/24, if we apply the mask value 24 then you will get network id as 11.1.10/24
For the machine A, B, C, D if we apply the mask value 24 to their respective ip addresses you will get the same network id
If you apply a mask value 24 on an IP address 10.1.1.1 then you will get network id as 10.1.1.0/24
Note: for a router, each interface lies in a different subnet, for example, the router interface-id 10.1.1.1 lies in subnet 10.1.10/24, and the interface-id 11.1.1.1 lies in the subnet 11.1.1.0/24
So, for an L3 router, each interface of the L3 router always lies in a different subnet
It will be said misconfiguration if the two interfaces of the same router fall in the same subnet
Router/machine | Local subnet | Remote subnet |
Router | 10.1.1.0/24 11.1.1.0/24 | |
A | 11.1.1.0/24 | 10.1.1.0/24 |
B | 11.1.1.0/24 | 10.1.1.0/24 |
C | 11.1.1.0/24 | 10.1.1.0/24 |
D | 11.1.1.0/24 | 10.1.1.0/24 |
Leave a Reply