These are chat archives for esp8266/Arduino

21st
May 2016
liangzelang
@liangzelang
May 21 2016 08:50
hello guys, who know how to config the UDP to broadcasting? and I read the sketch I found the _ip[3] will be set to 255 when broadcasting ....and what the meaning of _ip[3]=255 , ip=255,255,255,255 or ip=xxx,xxx,xxx,255
Gus Grubba
@dogmaphobic
May 21 2016 12:30

The broadcast address for an IPv4 host can be obtained by performing a bitwise OR operation between the bit complement of the subnet mask and the host's IP address. In other words, take the host's IP address, and set to '1' any bit positions which hold a '0' in the subnet mask.

Example: For broadcasting a packet to an entire IPv4 subnet using the private IP address space 172.16.0.0/12, which has the subnet mask 255.240.0.0, the broadcast address is 172.16.0.0 | 0.15.255.255 = 172.31.255.255.

A special definition exists for the IP broadcast address 255.255.255.255. It is the broadcast address of the zero network or 0.0.0.0, which in Internet Protocol standards stands for this network, i.e. the local network. Transmission to this address is limited by definition, in that it is never forwarded by the routers connecting the local network to other networks.

Michael Miller
@Makuna
May 21 2016 18:50
@liangzelang Make sure you are clear on the difference between broadcast and multicast, most protocols will use multicast instead.
Gus Grubba
@dogmaphobic
May 21 2016 18:52
He cross posted this in a few places. The context was broadcasting.
He was looking at my code here: