If i put the TTL as 0, will it never leave my broadcast domain? If I wanna send something to someone in my broadcast domain, can the ttl be 0 or will it still be dropped? Or should it be 1?
2 Answers
Packets with TTL 0
will be dropped at the interface.
Link-local protocols, like multicast (by default), use a TTL of 1
to be confined to the broadcast domain.
-
Multicast is not by default link-local. Some groups are, but the protocol itself is not. (multicast routing is a thing.)– RickyCommented Jan 15 at 12:24
-
Yes multicast routing is a thing, but part of that increases the TTL, which from the sender is normally
1
. That is something that gets people when first trying to route multicast traffic. The multicast router sets the TTL to somethng larger than1
.– Ron Maupin ♦Commented Jan 15 at 13:30 -
MR does not change (reset) the TTL. The user / application must set the TTL appropriately. A router is supposed to drop link-local group traffic with a TTL != 1. Eg. if you want multicast NTP to span your network, you have to set the TTL to something other than 1.– RickyCommented Jan 15 at 14:17
See RFC 791:
If the time to live reaches zero before the internet datagram reaches its destination, the internet datagram is destroyed.
Accordingly, a packet with TTL=0 can only be processed locally but cannot be sent anywhere any more. TTL=1 guarantees a packet cannot be forwarded outside the local subnet.
Most implementations decrease TTL on reception and drop the packet before it is sent from any interface.