Friday, December 4, 2015

ip - Can a limited broadcast packet contain destination MAC address other than FF:FF:FF:FF:FF:FF?



Can a limited broadcast contain destination MAC address other than FF:FF:FF:FF:FF:FF?



If the answer is true, could you provide an example of a protocol that uses a packet like this.



Ok, to elaborate on this a little further and to show what I think of it:



Lets suppose we are sending an IP packet that is a limited broadcast packet. A limited broadcast packet has the IP Destination field filled with: 255.255.255.255. 255.255.255.255 means that the packet is destined to '_this_' _Local_ Area Network (L2 network). 255.255.255.255 informs the software crafting a frame wrapper for the packet, that the packet is destined to _this_ L2 network. To transfer an IP packet over the LAN network, I can use multiple protocols:




enter image description here



depending on what type of medium I want to transfer the packet through (or what L2 protocol I want to use, if multiple L2 protocols available for a medium?).



Now, as I can't really obtain L2 address of a host 255.255.255.255 (because this host does not exist), a logical move for the software crafting the L2 wrapper would be to assign 'a default' lower level (L2) broadcast address for the frame Destination field (whatever the L2 protocol is). This would be a logical move.



I've originally asked the question because I realized that, besides of Ethernet, there are also other L2 protocols I can use to transfer the packet. So if the question was formulated like: "Can a limited broadcast packet contain information about L2 broadcast address other than MAC FF:FF:FF:FF:FF:FF ?", the answer would be: yes. Because I can use L2 protocol other than the Ethernet.



Is my thinking correct on this?



Answer



http://en.wikipedia.org/wiki/Multicast_address#Ethernet




Ethernet frames with a value of 1 in the least-significant bit of the first octet of the destination address are treated as multicast frames and are flooded to all points on the network.




That basically equates to any address where the second hex digit is 1, 3, 5, 7, 9, B, D, or F.



When you say other limited broadcast, I assume what you mean to say is multicast. Multicast and broadcast Ethernet addresses are not determined by asking the network via ARP for the hardware address that corresponds to the IP address. Rather, it is defined by any appropriately implemented IP stack. Microsoft offers a good document for understanding multicast Ethernet to IP mappings.




Ultimately, though, any L2 address that isn't known by a switch or bridge will flood that L2 segment. Things will only leave the segment if they are interpreted above L2. A network card will only pass packets to the OS where the packet matches its own address or where that second hex digit is one of the ones listed above.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...