简体   繁体   English

了解链路层多播

[英]understanding link layer multicasting

I am fairly new to network programming especially L2. 我对网络编程特别是L2很陌生。

I am working on an implementation of LLDP(Link Layer Discovery Protocol) in C. I understand that multicasting over link layer works on directly connected LAN devices. 我正在研究C语言中的LLDP(链路层发现协议)的实现。我了解通过链路层进行的多播在直接连接的LAN设备上有效。 My aim is to have it work across VLAN's (Eg: a device in 10.1.1.0 pool should be able to receive L2 multicast packets sent by a device in 192.168.1.0). 我的目标是使它跨VLAN工作(例如:10.1.1.0池中的设备应该能够接收192.168.1.0中的设备发送的L2组播数据包)。 Is there a possible way to achieve this ..or am I missing something vital here? 是否有可能实现这一目标..或者我在这里缺少重要的东西吗?

Wireshark wiki on LLDP says: LLDP上的Wireshark Wiki说:

LLDP Data Units (LLDPDUs) are sent to the destination MAC address 01:80:c2:00:00:0e . LLDP数据单元(LLDPDU)发送到目标MAC地址01:80:c2:00:00:0e This address is defined as the "LLDP_Multicast" address. 该地址定义为“ LLDP_Multicast”地址。 This address is defined within a range of addresses reserved by the IEEE for protocols that are to be constrained to an individual LAN . 该地址在IEEE保留的地址范围内定义,以用于将协议限制在单个LAN中的协议 AN LLDPDU will not be forwarded by MAC bridges (eg switches) that conform to IEEE Std 802.1D-2004. 符合IEEE Std 802.1D-2004的MAC桥接器(例如,交换机)将不会转发LLDPDU。

  1. so does that mean that a switch or a router just ignores link layer multicast packets coming from another device in another subnet? 这是否意味着交换机或路由器仅忽略来自另一个子网中另一个设备的链路层多播数据包? does multicast over link layer work only on directly connected devices? 链路层组播仅在直接连接的设备上有效吗?

  2. what is the scope of a data link layer multicast address? 数据链路层多播地址的范围是什么?

Link-local multicasts will not be propagated off a link. 链接本地多播将不会从链接传播出去。 Because of that, the question of ignoring, or not, a link-local multicast from another link will never come up. 因此,永远不会出现忽略或不忽略来自另一个链接的链接本地多播的问题。

You will not be successful in creating an LLDP implementation which originates on one link and is received on a different link. 您将无法成功创建源自一个链接并在另一链接上接收到的LLDP实现。 You will need to create a completely different protocol to do what you want, and you will need to change the software on the network devices to recognize this new protocol. 您将需要创建完全不同的协议来执行所需的操作,并且需要更改网络设备上的软件以识别此新协议。 This will not be possible with network devices which run proprietary software. 对于运行专有软件的网络设备,这是不可能的。

From your question, it seems you are mixing L2 and L3 technologies. 从您的问题来看,您似乎正在混合使用L2和L3技术。 If you are dealing L2 multicast, IP addresses have no meaning there. 如果您正在处理L2组播,则IP地址在那里没有任何意义。

As for the questions: 至于问题:

1) When talking about switches, you have to consider if a switch is 802.1D compliant or not. 1)在谈论交换机时,必须考虑交换机是否符合802.1D要求。 A dumb switch (a. la Generic $5 from a store next door) will treat your LLDP PDU as a broadcast frame and will distribute it to all other ports except for the one it received it from. 哑交换机(从隔壁的一家商店借来的Generic $ 5)将您的LLDP PDU视为广播帧,并将其分发到所有其他端口,除了从其接收的端口。 This is because MAC address starts with 01 which indicates that the group address bit is set. 这是因为MAC地址以01开头,表示组地址位已设置。

A switch which is 802.1D compliant will not forward this frame anywhere. 符合802.1D的交换机将不会在任何地方转发此帧。 It might process it locally to learn about a device sending it. 可能会在本地处理它,以了解发送它的设备。 This will happen if the switch has LLDP protocol support enabled. 如果交换机启用了LLDP协议支持,则会发生这种情况。

A router will act in the same way as a 802.1D compliant switch. 路由器将以与802.1D兼容交换机相同的方式工作。 It will not forward the LLDP frame and might process it if the LLDP is enabled. 如果启用了LLDP,它将不会转发LLDP帧,并且可能会对其进行处理。

A PC will act the same was as a router. PC的行为与路由器相同。

2) Scope will depend on the endpoints of a link. 2)范围将取决于链接的端点。 Any smart device will terminate the journey of the LLDP frame. 任何智能设备都将终止LLDP帧的运行。 A dumb switch will treat it as a broadcast frame. 哑开关会将其视为广播帧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM