BroadcastAddress (broadcast address) is an address used to send messages to all workstations in the network at the same time. In a network that uses the TCPIP protocol, the IP address of the host ID segment hostID of all 1 is the broadcast address, broadcast... broadcast Address (Broadcast Address) is an Address used to send messages to all workstations in the network at the same time. In a network using the TCP/IP protocol, the IP address of host ID 1 in the host identification segment is the broadcast address, and the Broadcast Group is sent to all computers involved in the host ID segment.
Network broadcast address calculation method:
(1) perform "bit and" operations on the IP address and subnet mask to obtain the network address
(2) calculate the subnet mask "" and perform "bit or" operations with the network address to obtain the broadcast address.
0) $ ipBin = "0 ". $ ipBin; $ maskBin = sprintf ("% B", $ maskSplit [$ I]); while (8-strlen ($ maskBin)> 0) $ maskBin = "0 ". $ maskBin; $ broadcastBin = null; for ($ j = 0; $ j <8; $ j ++) {$ broadcastBin. = (! Intval (substr ($ maskBin, $ j, 1) | (intval (substr ($ ipBin, $ j, 1) & intval (substr ($ maskBin, $ j, 1);} if ($ I> 0) $ broadcast. = ". "; $ broadcast. = bindec ($ broadcastBin);} return $ broadcast ;}
Tutorial link:
Reprint at will ~ However, please keep the tutorial address★