Каково точное использование ограниченного широковещательного адреса?

3817
Vishnu Vivek

Я читал, что ограниченные широковещательные адреса будут сброшены маршрутизатором. Таким образом, он не используется на уровне 3 (сетевой уровень), где предполагается использовать IP-адреса. Итак, где именно это используется?

1

1 ответ на вопрос

6
MariusMatutiae

The fact that it is dropped by routers (true!) does not mean it is not used in layer-3. Where else could it be used?

You are misunderstanding the use of directed and limited broadcasts. 255.255.255.255 is a limited broadcast: it is not passed on by routers, so it is really useful only to a member of a LAN to contact all other members of the same LAN. But routers will not forward these broadcasts because, if they did, these broadcasts would fill the whole internet. So they are useful, in Layer-3, and limited.

Directed broadcasts are represented by, for instance, 192.168.1.255. These are passed on by routers, because of course they are less invasive than 255.255.255.255, even though this feature is often disabled in real-world routers because it is easily abused (you'll see why in a second). If I am a member of of the subnet 192.168.1.0/24, then it makes little difference whether I use as a broadcast 255.255.255.255or 192.168.1.255.But suppose now I am a member of the subnet 192.168.2.0/24, and I want to send a broadcast to all members of a different subnet, say, 192.168.1.0/24. How can I do that? I cannot use 255.255.255.255 because that is restricted to the LAN of the emitter, 192.168.2.0/24 in this example, and thus it will never reach 192.168.1.0/24 because routers drop these packets. But, aha, I can use 192.168.1.255 from outside 192.168.1.0/24 to reach all members of the network with a single broadcast, because the router separating my subnet, 192.168.2.0/24 from the target subnet, 192.168.1.0/24 will pass these packets on.

You may wonder when a proper use case for directed broadcasts is: the answer is, when you cannot use unicast. For instance, in Wake On LAN (WOL), I cannot send a unicast packet because the pc that must receive it is turned off, and thus has no IP address, so I must use a broadcast. But if I am doing this from outside the sleeping pc subnet, then I need to use a directed broadcast.

As you can see, both limited and directed broadcasts are quite useful, whether routers pass them along or not.

Таким образом, широковещательная передача WOL на 192.168.255.255 пробудит всех на 192.168.1.0, 192.168.2.0 и других? ott-- 8 лет назад 1
@ ott-- Пакет WOL должен включать в себя MAC-адрес компьютера, который должен быть разбужен, поэтому ** нет **, не все ПК будут разбужены, даже если все получат широковещательное сообщение, но затем они отбросят его, когда они сравнивают целевой MAC со своим собственным. MariusMatutiae 8 лет назад 1