Multicast address

Error Handling

Once an mdns-server instance is created it will attempt to emit all errors as an
‘error’ event type. Unhandled error events may cause an application to crash so
it is recommended to add an error listener to any mdns-server instances.

I.E.

var mdns =require('mdns-server')({  reuseAddrtrue,  loopbacktrue,  noInittrue})mdns.on('error',function(error){console.log('mDNS Server Error',error.message);})mdns.initServer()

When using the auto server initialization by not specifying the noInit: true
option it is possible for an error to occur before your error listener is ready.
In this case a try {} catch {} may be needed when creating the server instance…

var mdns;try{  mdns =require('mdns-server')({    reuseAddrtrue,    loopbacktrue,})}catch(error){console.log('mDNS Server Init Error',error.message);}mdns.on('error',function(error){console.log('mDNS Server Error',error.message);})

Advertising your Arduino using mDNS

Your Arduino program needs to advertise its services so they can be found by mDNS clients. For mDNS, a service is a name, protocol and port number. The client trying to connect to your program will use this information to resolve the Arduino’s IP address and open the connection.

The ESP8266 tool-chain for Arduino includes a compatible mDNS server. To use this server, you’ll need to

  1. include , start the mDNS server and register the service,
  2. Call to start the server. Here, is the name that will identify your device on the network, so it should be unique. The example below creates a unique name by appending the chip id to the program name using the custom function .
  3. Call to advertise the service. The service end-point will be advertised as . For example, if you call in your Arduino program, the end-point will be named . Add the end-point to MegunoLink’s list of services so it will find your device.

Multicast group joins status

Menu: /routing pim join

Group join list of all the group joins that are registered by PIM-SM
Multicast forwarding cache — this section only provides information about current state of multicast cloud at given router, showing states of joins for multicast groups.

Property Desciption
group (IP address) multicast group that has at least one registered join request
source (IP address) data provider for that group
rp (IP address) rendezvous point for multicast group
upstream-interface-source (interface) router interface receives data stream of the multicast group
upstream-interface-rp (interface) router interface that is toward the rendezvous point
upstream-mrib-nexthop (IP address) address of the next router towards RP
upstream-pim-nexthop (IP address) address of next router towards RP according to PIM RP tree
join-state (joined | not-joined | rpt-not-joined | rpt-pruned | rpt-not-pruned) state of this entry towards RP
join-register-state (joined | pruned | join-pending | unknown) join status on register interface
timeout (time) time-out when entry will be removed from the list.
keepalive-timer (yes|no) how long entry will be kept in the list
i-am-designated-router (interface list) interface name list on which router is chosen as designated router
local-receivers (interface list) interfaces where are clients registered with (*.G) join
joined-rp (interface list) list of interfaces that have clients that originated (*,*,RP) join
joined-wc (interface list) list of interfaces that have clients that originated (*.G) join
joined (interface list) list of interfaces that are in joined state
pruned (interface list) list of interfaces that are in prune state
prune-pending () list of interfaces that are in prune-pending state
assert-winner (interface list) list of interfaces that are in assert-winner state
assert-looser (interface list) list of interfaces that are assert-lost state
assert-winner-wc (interface list) list of interfaces that have (*,G) join and have assert-winner state
assert-looser-wc (interface list) list of interfaces that have (*,G) join and have assert-lost state
assert-tracking-wc (interface list) list of interfaces that have (*,G) join and will track assert
could-assert-wc (interface list) list of interfaces that have (*,G) join and could trigger assert
immediate-rp (interface list) list of interfaces that are included in the immediate outgoing interfaces for the corresponding (*,*,RP) entry.
immediate-wc (interface list) list of interfaces that are included in the immediate outgoing interfaces for the corresponding (*,RP) entry.
immediate-sg (interface list) list of interfaces that are included in the immediate outgoing interfaces for the corresponding (S,G) entry.
immediate-sg-rpt (interface list) list of interfaces that are included in the immediate outgoing interfaces for the corresponding (S,G,rpt) entry.
include-wc (interface list) list of interfaces to which traffic might be forwarded because of hosts that are local members on that interface.

IPv6

General multicast address format (old)
Bits 8 4 4 112
Field prefix flags scope group ID
General multicast address format (new)
Bits 8 4 4 4 4 8 64 32
Field prefix ff1 scope ff2 reserved plen network prefix group ID

The prefix holds the value ff for all multicast addresses.

Currently, 3 of the 4 flag bits in the flags field (ff1) are defined; the most-significant flag bit is reserved for future use. The other three flags are known as R, P and T.

Multicast address flags
Bit Flag 1
0 (MSB) Reserved (Reserved) (Reserved)
1 R (Rendezvous) Rendezvous point not embedded Rendezvous point embedded
2 P (Prefix) Without prefix information Address based on network prefix
3 (LSB) T (Transient) Well-known multicast address Dynamically assigned multicast address

Similar to a unicast address, the prefix of an IPv6 multicast address specifies its scope, however, the set of possible scopes for a multicast address is different. The 4-bit sc (or scope) field (bits 12 to 15) is used to indicate where the address is valid and unique.

Multicast address scope
IPv6 address IPv4 equivalent Scope Purpose
ff00::/16, ff0f::/16 Reserved
ffx1::/16 127.0.0.0/8 Interface-local Packets with this destination address may not be sent over any network link, but must remain within the current node; this is the multicast equivalent of the unicast loopback address.
ffx2::/16 224.0.0.0/24 Link-local Packets with this destination address may not be routed anywhere.
ffx3::/16 239.255.0.0/16 IPv4 local scope
ffx4::/16 Admin-local The smallest scope that must be administratively configured.
ffx5::/16 Site-local Restricted to the local physical network.
ffx8::/16 239.192.0.0/14 Organization-local Restricted to networks used by the organization administering the local network. (For example, these addresses might be used over VPNs; when packets for this group are routed over the public internet (where these addresses are not valid), they would have to be encapsulated in some other protocol.)
ffxe::/16 224.0.1.0-238.255.255.255 Global scope Eligible to be routed over the public internet.

The service is identified in the group ID field. For example, if ff02::101 refers to all Network Time Protocol (NTP) servers on the local network segment, then ff08::101 refers to all NTP servers in an organization’s networks. The group ID field may be for special multicast address types.

Notable IPv6 multicast addresses

The following table is a list notable IPv6 multicast addresses that are registered with IANA.

Address Description
ff02::1 All nodes on the local network segment
ff02::2 All routers on the local network segment
ff02::5 OSPFv3 All SPF routers
ff02::6 OSPFv3 All DR routers
ff02::8 IS-IS for IPv6 routers
ff02::9 RIP routers
ff02::a EIGRP routers
ff02::d PIM routers
ff02::16
ff02::1:2
ff02::1:3
ff05::1:3
ff0x::c
ff0x::fb
ff0x::101 Network Time Protocol
ff0x::108 Network Information Service
ff0x::181 Precision Time Protocol (PTP) version 2 messages (Sync, Announce, etc.) except peer delay measurement
ff02::6b Precision Time Protocol (PTP) version 2 peer delay measurement messages
ff0x::114 Used for experiments

Example

Almost minimal setup where multicast routing is necessary:

  • multicast sender (server);
  • multicast receiver (client);
  • two routers running PIM between them.

Multicast traffic in this example will be destined to address 224.0.1.20

Traffic flow:

 Sender -- (subnet I) --> Router A -- (subnet II) --> Router B -- (subnet III) --> Receiver

Router A will be configured as Rendezvous Point.

Enable PIM and IGMP router A:

 > routing pim interface add interface=all
 > routing pim interface print
Flags: X - disabled, I - inactive, D - dynamic, R - designated-router,
v1 - IGMPv1, v2 - IGMPv2, v3 - IGMPv3
 #      INTERFACE    PROTOCOLS
 0   v2 all          pim
                     igmp
 1 DRv2 ether3       pim
                     igmp
 2 DR   register     pim

Configure static Rendezvous Point:

 > routing pim rp add address=<IP of router A>

You may also need to configure alternative-subnets on upstream interface — in case if the multicast sender address is in an IP subnet that is not directly reachable from the local router.

 > routing pim interface set <upstream-interface> alternative-subnets=1.2.3.0/24,2.3.4.0/24

Enable PIM and IGMP router B:

 > routing pim interface add interface=ether1
 > routing pim interface print
Flags: X - disabled, I - inactive, D - dynamic, R - designated-router,
v1 - IGMPv1, v2 - IGMPv2, v3 - IGMPv3
 #      INTERFACE    PROTOCOLS
 0  Rv2 ether1       pim
                     igmp
 1 DR   register     pim

Configure static Rendezvous Point:

 > routing pim rp add address=<IP of router A>

Add route on multicast sender:

# ip route add 224.0.1.20/32 via <IP of router A>

Start sender and receiver programs. You can either write simple programs yourself, or use any of these:

And hey, it works! Client should receive data now.

Usage

var mdns =require('mdns-server')({  reuseAddrtrue,  loopbacktrue,  noInittrue})mdns.on('response',function(response){console.log('got a response packet:')var a =if(response.answers){    a =a.concat(response.answers)}if(response.additionals){    a =a.concat(response.additionals)}console.log(a)})mdns.on('query',function(query){console.log('got a query packet:')var q =if(query.questions){    q =q.concat(query.questions)}console.log(q)})mdns.on('destroyed',function(){console.log('Server destroyed.')process.exit()})mdns.on('ready',function(){mdns.query({    questions{      name'_services._dns-sd._udp.local',      type'PTR'}})})mdns.initServer()setTimeout(function(){mdns.destroy()},10000)

In this example a query will be sent on all available IPv4
and IPv6 interfaces. With loopback enabled these queries
should be recorded by the server. I.E.

got a query packet:got a query packet:

Here there were two query packets because the system has
both an IPv4 and IPv6 address on one interface.

Assuming a device on the local network matches the query
request for ‘foo.local’ the server should record a
response similar to the following…

got a response packet:

Using the mDNS Browser

Open the mDNS Browser by selecting mDNS Configuration from MegunoLink’s gear menu. You can use the Start and Stop buttons to start and stop the mDNS client.

Click the Edit button to show the Manage Services window to setup the services you are interested in (you’ll need to stop the mDNS client first if it is running). Click the New to add a service name, Edit to change an existing name or Delete to remove an entry from the list. Enter the end-point of the service (see below). MegunoLink will search for devices advertising any service in the list.

Select the mDNS services that MegunoLink should search for.

mDNS support is built-into MegunoLink

MegunoLink contains a simple mDNS client (so it doesn’t require any external services such as Bonjour). The mDNS client periodically looks for devices on your network which advertise the services you are interested in. A service, is simply a named port that your Arduino program opens to communicate with the outside world. The Arduino advertises the name of the port using a library, such as the ESP8266mDNS library for the ESP8266 WiFi module.

Each device can advertise many service end-points and many devices may advertise the same type of end-point. Each device should have a unique name, so you can choose the one you want to connect to. In MegunoLink, you’ll select your connection by the type of service and the name of the device.

Bootstrap router candidates

Menu: /routing pim bsr-candidates

bootstrap router candidate configuration

Property Desciption
comment (text) set text describing bsr-candidate list entry
disabled (yes|no Default: no) set state of the list entry
hash-mask-length (number 4..32 Default: 30) to how much first bits of multicast group should be hashed to reduce protocol overhead
is-scope-zone (yes|no Default: no) if set to yes, scope-zone setting is obeyed, if set to no, then scope-zone just represents range of groups that it will function as BSR
priority (number Default: 1) priority of the router in bsr election
scope-zone (IP address/mask Default: 224.0.0.0/4) multicast group range that this router will function as BSR
interface (interface) interface of the router that bsr-candidate will be attached to and if elected BSR

Causes of Multicast MAC address question?

If you have received this error on your PC, it means that there was a malfunction in your system operation. Common reasons include incorrect or failed installation or uninstallation of software that may have left invalid entries in your Windows registry, consequences of a virus or malware attack, improper system shutdown due to a power failure or another factor, someone with little technical knowledge accidentally deleting a necessary system file or registry entry, as well as a number of other causes. The immediate cause of the «Multicast MAC address question» error is a failure to correctly run one of its normal operations by a system or application component.

Television

In digital television, the concept of multicast service sometimes is used to refer to content protection by broadcast encryption, i.e. encrypted content over a simplex broadcast channel only addressed to paying viewers (pay television). In this case, data is broadcast (or distributed) to all receivers but only addressed to a specific group.

The concept of interactive multicast, for example using IP multicast, may be used over TV broadcast networks to improve efficiency, offer more TV programs, or reduce the required spectrum. Interactive multicast implies that TV programs are sent only over transmitters where there are viewers and that only the most popular programs are transmitted. It relies on an additional interaction channel (a back-channel or return channel), where user equipment may send join and leave messages when the user changes TV channel. Interactive multicast has been suggested as an efficient transmission scheme in DVB-H and DVB-T2 terrestrial digital television systems, A similar concept is switched broadcast over cable-TV networks, where only the currently most popular content is delivered in the cable-TV network.Scalable video multicast in an application of interactive multicast, where a subset of the viewers receive additional data for high-resolution video.

TV gateways converts Satellite (DVB-S, DVB-S2), Cable (DVB-C, DVB-C2) and Terrestrial television (DVB-T, DVB-T2) to IP for distribution using unicast and multicast in home, hospitality and enterprise applications

Another similar concept is Cell-TV, and implies TV distribution over 3G cellular networks using the network-assisted multicasting offered by the Multimedia Broadcast Multicast Service (MBMS) service, or over 4G/LTE cellular networks with the eMBMS (enhanced MBMS) service.

Usage

var mdns =require('multicast-dns')()mdns.on('response',function(response){console.log('got a response packet:', response)})mdns.on('query',function(query){console.log('got a query packet:', query)})mdns.query({  questions{    name'brunhilde.local',    type'A'}})

Running the above (change to ) will print an echo of the query packet first

got a query packet{ type'query',  questions{ name'brunhilde.local', type'A', class1},  answers,  authorities,  additionals}

And then a response packet

got a response packet{ type'response',  questions,  answers{ name'brunhilde.local',       type'A',       class'IN',       ttl120,       flushtrue,       data'192.168.1.5'},  authorities,  additionals{ name'brunhilde.local',       type'A',       class'IN',       ttl120,       flushtrue,       data'192.168.1.5'},{ name'brunhilde.local',       type'AAAA',       class'IN',       ttl120,       flushtrue,       data'fe80::5ef9:38ff:fe8c:ceaa'}}

A packet has the following format

{  questions{    name'brunhilde.local',    type'A'},  answers{    name'brunhilde.local',    type'A',    ttlseconds,    data(record type specific data)},  additionals(same format as answers),  authorities(same format as answers)}

Currently data from , , , , and records is passed

Creates a new instance. Options can contain the following

{  multicasttrue  interface'192.168.0.2'  port5353,  ip'224.0.0.251',  ttl255,  loopbacktrue,  reuseAddrtrue}

Emitted when a query packet is received.

mdns.on('query',function(query){if(query.questions&&query.questions.name==='brunhilde.local'){mdns.respond(someResponse)}})

Emitted when a response packet is received.

The response might not be a response to a query you send as this
is the result of someone multicasting a response.

Send a dns query. The callback will be called when the packet was sent.

The following shorthands are equivalent

mdns.query('brunhilde.local','A')mdns.query({name'brunhilde.local', type'A'})mdns.query({  questions{name'brunhilde.local', type'A'}})

Send a dns response. The callback will be called when the packet was sent.

mdns.respond({  answers{    name'my-service',    type'SRV',    data{      port9999,      weigth,      priority10,      target'my-service.example.com'}},{    name'brunhilde.local',    type'A',    ttl300,    data'192.168.1.5'}})

The following shorthands are equivalent

mdns.respond({name'brunhilde.local', type'A', data'192.158.1.5'})mdns.respond({  answers{name'brunhilde.local', type'A', data'192.158.1.5'}})

Destroy the mdns instance. Closes the udp socket.

To start hacking on this module you can use this example to get started

Usage

var mdns =require('multicast-dns')()mdns.on('response',function(response){console.log('got a response packet:', response)})mdns.on('query',function(query){console.log('got a query packet:', query)})mdns.query({  questions{    name'brunhilde.local',    type'A'}})

Running the above (change to ) will print an echo of the query packet first

got a query packet{ type'query',  questions{ name'brunhilde.local', type'A', class1},  answers,  authorities,  additionals}

And then a response packet

got a response packet{ type'response',  questions,  answers{ name'brunhilde.local',       type'A',       class'IN',       ttl120,       flushtrue,       data'192.168.1.5'},  authorities,  additionals{ name'brunhilde.local',       type'A',       class'IN',       ttl120,       flushtrue,       data'192.168.1.5'},{ name'brunhilde.local',       type'AAAA',       class'IN',       ttl120,       flushtrue,       data'fe80::5ef9:38ff:fe8c:ceaa'}}

A packet has the following format

{  questions{    name'brunhilde.local',    type'A'},  answers{    name'brunhilde.local',    type'A',    ttlseconds,    data(record type specific data)},  additionals(same format as answers),  authorities(same format as answers)}

Currently data from , , , , and records is passed

Creates a new instance. Options can contain the following

{  multicasttrue  interface'192.168.0.2'  port5353,  ip'224.0.0.251',  ttl255,  loopbacktrue,  reuseAddrtrue}

Emitted when a query packet is received.

mdns.on('query',function(query){if(query.questions&&query.questions.name==='brunhilde.local'){mdns.respond(someResponse)}})

Emitted when a response packet is received.

The response might not be a response to a query you send as this
is the result of someone multicasting a response.

Send a dns query. The callback will be called when the packet was sent.

The following shorthands are equivalent

mdns.query('brunhilde.local','A')mdns.query({name'brunhilde.local', type'A'})mdns.query({  questions{name'brunhilde.local', type'A'}})

Send a dns response. The callback will be called when the packet was sent.

mdns.respond({  answers{    name'my-service',    type'SRV',    data{      port9999,      weigth,      priority10,      target'my-service.example.com'}},{    name'brunhilde.local',    type'A',    ttl300,    data'192.168.1.5'}})

The following shorthands are equivalent

mdns.respond({name'brunhilde.local', type'A', data'192.158.1.5'})mdns.respond({  answers{name'brunhilde.local', type'A', data'192.158.1.5'}})

Destroy the mdns instance. Closes the udp socket.

To start hacking on this module you can use this example to get started

Ethernet

Ethernet frames with a value of 1 in the least-significant bit of the first octet of the destination MAC address are treated as multicast frames and are flooded to all points on the network. While frames with ones in all bits of the destination address (FF-FF-FF-FF-FF-FF) are sometimes referred to as broadcasts, Ethernet generally does not distinguish between multicast and broadcast frames. Modern Ethernet controllers filter received packets to reduce CPU load, by looking up the hash of a multicast destination address in a table, initialized by software, which controls whether a multicast packet is dropped or fully received.

The IEEE has allocated the address block 01-80-C2-00-00-00 to 01-80-C2-FF-FF-FF for group addresses for use by standard protocols. Of these, the MAC group addresses in the range of 01-80-C2-00-00-00 to 01-80-C2-00-00-0F are not forwarded by 802.1D-conformant MAC bridges.

Some well known Ethernet multicast addresses
Ethernet multicast address Ethertype Usage
01-00-0C-CC-CC-CC Cisco Discovery Protocol (CDP), VLAN Trunking Protocol (VTP), Unidirectional_Link_Detection (UDLD)
01-00-0C-CC-CC-CD Cisco Shared Spanning Tree Protocol Address[citation needed]
01-80-C2-00-00-00 Spanning Tree Protocol (for bridges) IEEE 802.1D
01-80-C2-00-00-00, 01-80-C2-00-00-03 or 01-80-C2-00-00-0E 0x88CC Link Layer Discovery Protocol
01-80-C2-00-00-08 0x0802 Spanning Tree Protocol (for provider bridges) IEEE 802.1ad
01-80-C2-00-00-01 0x8808 Ethernet flow control (pause frame) IEEE 802.3x
01-80-C2-00-00-02 0x8809 «Slow protocols» including Ethernet OAM Protocol (IEEE 802.3ah) and Link Aggregation Control Protocol (LACP)
01-80-C2-00-00-21 0x88f5 GARP VLAN Registration Protocol (also known as IEEE 802.1q GVRP)
01-80-C2-00-00-30 through 01-80-C2-00-00-3F 0x8902 Ethernet CFM Protocol IEEE 802.1ag
01-00-5E-00-00-00 through 01-00-5E-7F-FF-FF 0x0800
33-33-00-00-00-00 through 33-33-FF-FF-FF-FF 0x86DD
01-0C-CD-01-00-00 through 01-0C-CD-01-01-FF 0x88B8 IEC 61850-8-1 GOOSE Type 1/1A
01-0C-CD-02-00-00 through 01-0C-CD-02-01-FF 0x88B9 GSSE (IEC 61850 8-1)
01-0C-CD-04-00-00 through 01-0C-CD-04-01-FF 0x88BA Multicast sampled values (IEC 61850 8-1)
01-1B-19-00-00-00 or 01-80-C2-00-00-0E 0x88F7 Precision Time Protocol (PTP) version 2 over Ethernet (native layer-2)
Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector