Daily Learning: Computer Networks – Casting & Subnet & Subnet Mask

Casting

Sending some data from one host to another host is called casting. There are three type of casting –

  1. Unicast – When we are sending message from one host to one host. The packet consist of | data | Source Address | Destination Address |
  2. Broadcasting –
    1. 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 |
    2. 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 | 20.255.255.255 |
  3. 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.

Subnet

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 193.1.2.0 and we divide the network into two parts. Subnet 1 = we get the range 193.1.2.00000000(193.1.2.0) – 193.1.2.01111111(193.1.2.127). Here the 193.1.2.0 is the subnet ID and 193.1.2.127 is the Direct Broadcasting address. Subnet 2 = we get the range 193.1.2.10000000(193.1.2.128) – 193.1.2.11111111(193.1.2.255). Here the 193.1.2.128 is the subnet ID and 193.1.2.255 is the Direct Broadcasting address.

Subnet Mask

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 200.1.2.30 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
200.1.2.0

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s