Exp 5
Exp 5
5. Take an example subnet of hosts and obtain a broadcast tree for the subnet.
#include <stdio.h>
#include <stdlib.h>
#define MAX_HOSTS 4
return 0;
}
Output :
Explanation
What is a Subnet?
A subnet (short for "subnetwork") is a logical subdivision of an IP network. The main purpose of
subnetting is to improve network performance and security by dividing a larger network into
smaller, more manageable segments. Each subnet operates independently and can be managed
separately.
Key Components of a Subnet:
• IP Address: A unique identifier for each device on a network (e.g., 192.168.1.1).
• Subnet Mask: Used to determine which portion of an IP address is the network part and
which part is the host part (e.g., 255.255.255.0).
• Network Address: Identifies the subnet and is obtained by performing a bitwise AND
operation between the IP address and the subnet mask (e.g., 192.168.1.0).
• Broadcast Address: Used to send data to all devices on the subnet. It is obtained by setting
all the host bits in the IP address to 1 (e.g., 192.168.1.255).
What is a Broadcast Tree?
A broadcast tree is a type of spanning tree used in computer networks to ensure that a broadcast
message sent by any node (host) reaches every other node in the network without causing loops. In
a broadcast tree, each node can reach every other node through the tree structure.