Sending some data from one host to another host is called casting. There are three type of casting –
- Unicast – When we are sending message from one host to one host. The packet consist of | data | Source Address | Destination Address |
- Broadcasting –
- Limited Broadcasting – When a host want to send a packet to everyone in the same network then it use Limited Broadcasting. The packet consist of | data | Source Address | 255.255.255.255 |
- Direct Broadcasting – When we are sending a message from one host of one network to all the host of other network then we use Directed Broadcasting. The packet consist of | data | Source Address | 126.96.36.199 |
- Multicast – Transmitting data from one source host to a particular group of hosts that are interested in receiving the data is called Multicast. It is also called one to many transmissions.
When a bigger network is divided into sub network to maintain security is called subnetting.
In order to divide the network into two parts you need select 1 bit from 8 bit of the host ID part.
The above network is class C network and the NID is 188.8.131.52 and we divide the network into two parts. Subnet 1 = we get the range 193.1.2.00000000(184.108.40.206) – 193.1.2.01111111(220.127.116.11). Here the 18.104.22.168 is the subnet ID and 22.214.171.124 is the Direct Broadcasting address. Subnet 2 = we get the range 126.96.36.19900000(188.8.131.52) – 184.108.40.20611111(220.127.116.11). Here the 18.104.22.168 is the subnet ID and 22.214.171.124 is the Direct Broadcasting address.
Suppose we divide a Class C network with 4 subnets. So in order to identify which packet belongs to which network we use subnet mask. It is a 32 bit number consist of 0 & 1. 1 = Network ID & Subnet ID 0 = Host ID So, for a IP address 126.96.36.199 the Subnet Mask is –
11111111.11111111.11111111.11000000 or 255.255.255.192
So, to identify which IP belongs to which subnet use use bitwise and operation on the subnet mask and the IP address.
11111111.11111111.11111111.11000000 && 11001000.00000001.00000010.00011110 ----------------------------------------------------- 11001000.00000001.00000010.00000000
The address belongs to subnet 1.
11001000.00000001.00000010.00000000 or 188.8.131.52
Internally there is a routing table which helps forward the packet.
Note: Some cases NID match with two entries, in that case the interface having longest subnet mask(More 1’s) is selected.