Understanding Broadcast Addresses
To use broadcasting, you must know about certain IP broadcast address conventions for IPv4. Recall that the IP address is
split between the Network ID portion on the left (the most significant bits) and the Host ID portion on the right (the least significant bits). The convention used for a broadcast address is that the Host ID bits are all set to 1 bits.
When your network card is properly configured, you can display the broadcast address for the interface of your choice by performing the following command (interface eth0 is shown in this example):
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:A0:4B:06:F4:8D
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:1955 errors:0 dropped:0 overruns:0 frame:31
TX packets:1064 errors:0 dropped:0 overruns:0 carrier:0
Here is the output that my Linux box is showing,
The second line of output shows the broadcast address for the eth0 interface to be 192.168.0.255. The Network ID in this address is the first three octets (bytes) 192.168.0, whereas the Host ID part of this address is the 255 (recall that this address is a class C address). The value 255 is a decimal value representing all 1 bits for the Host ID.