Search code examples
broadcastdatagram

Do the packages on a local network travel just to the destination host?


I'm wondering if an unicast message is sent only to the destination address or, does the package travel into the LAN and only the destination host recognize it as its? And the other hosts doesn't receive it because the destination address doesn't match with their IP address. So, if this is true, what is the difference between broadcasting and unicasting?

I got the same doubt with those messages who come from internet to the LAN. They have an IP destination address and the router sends them to a specific host, but does it really send the package to just one host? Or the router forward the message into the LAN and the only one who doesn't discards the message is the host who got the same IP address as the destination?.


Solution

  • When a packet comes onto the network addressed to a single host, it is a unicast packet. When a packet is addressed to everyone, it is a broadcast packet.

    A unicast packet doesn't get seen by a host to which it is not addressed. That is because of the differences between layer-2 and layer-3. A packet is a layer-3 construct which is encapsulated in a layer-2 frame. The NICs in all the hosts of a layer-2 domain will see the frame, but the hardware will discard those frames not addressed specifically to its MAC address or the broadcast MAC address. The host never sees the packet because the frame is never accepted.

    On the other hand, a broadcast packet is encapsulated in a broadcast frame, and every NIC in the layer-2 domain will accept the broadcast frame, discard the frame encapsulation, and send the layer-3 packet up to the host.