跳到主要內容

IPv6 Multicast Address 整理(草稿)

rfc 4291

Reserved Multicast Addresses:
  FF0X::0

All Nodes Addresses:  
  FF01:0:0:0:0:0:0:1
  FF02:0:0:0:0:0:0:1

All Routers Addresses:  
  FF01:0:0:0:0:0:0:2
  FF02:0:0:0:0:0:0:2
  FF05:0:0:0:0:0:0:2

Solicited-Node Address:
  FF02:0:0:0:0:1:FFXX:XXXX

   +--------+----+----+---------------------------------------------+
   |   8    |  4 |  4 |                  112 bits                   |
   +------ -+----+----+---------------------------------------------+
   |11111111|flgs|scop|                  group ID                   |
   +--------+----+----+---------------------------------------------+

flags:
                                    +-+-+-+-+
      flgs is a set of 4 flags:     |0|R|P|T|
                                    +-+-+-+-+

  T = 0 indicates a permanently-assigned ("well-known") multicast
  address, assigned by the Internet Assigned Numbers Authority
  (IANA).

  T = 1 indicates a non-permanently-assigned ("transient" or
  "dynamically" assigned) multicast address.

  P flag, RFC3306, Unicast-Prefix-based IPv6 Multicast Addresses
      +--------+----+----+--------+--------+----------------+----------+
      |   8    |  4 |  4 |   8    |    8   |       64       |    32    |
      +--------+----+----+--------+--------+----------------+----------+
      |11111111|flgs|scop|reserved|  plen  | network prefix | group ID |
      +--------+----+----+--------+--------+----------------+----------+
     
      example: A network with a unicast prefix of 3FFE:FFFF:1::/48 would also
               have a unicast prefix-based multicast prefix of
               FF3x:0030:3FFE:FFFF:0001::/96


  R flag, RFC3956, Embedding the Rendezvous Point (RP) Address in an IPv6 Multicast Address
      It can also be used as an automatic RP discovery mechanism in those
      deployment scenarios that would have previously used the Bootstrap
      Router protocol (BSR)

      +--------+----+----+----+----+----+----------------+----------+
      |   8    |  4 |  4 |  4 |  4 | 8  |       64       |    32    |
      +--------+----+----+----+----+----+----------------+----------+
      |11111111|flgs|scop|rsvd|RIID|plen| network prefix | group ID |
      +--------+----+----+----+----+----+----------------+----------+

    When the highest-order bit is 0, R = 1 indicates a multicast address
     that embeds the address on the RP.  Then P MUST be set to 1, and
     consequently T MUST be set to 1, as specified in [RFC3306]

    R = 0 indicates a multicast address that does not embed the address
       of the RP and follows the semantics defined i

scop:
         0  reserved
         1  Interface-Local scope
         2  Link-Local scope
         3  reserved
         4  Admin-Local scope
         5  Site-Local scope
         6  (unassigned)
         7  (unassigned)
         8  Organization-Local scope
         9  (unassigned)
         A  (unassigned)
         B  (unassigned)
         C  (unassigned)
         D  (unassigned)
         E  Global scope
         F  reserved

RFC 4541
2.  IGMP Snooping Recommendations
2.1.  Forwarding rules
2.1.2.  Data Forwarding Rules

   1) Packets with a destination IP address outside 224.0.0.X which are
      not IGMP should be forwarded according to group-based port
      membership tables and must also be forwarded on router ports.

   2) Packets with a destination IP (DIP) address in the 224.0.0.X range
      which are not IGMP must be forwarded on all ports.

3.  IPv6 Considerations
   In IPv6, the data forwarding rules are more straight forward because
   MLD is mandated for addresses with scope 2 (link-scope) or greater.
   The only exception is the address FF02::1 which is the all hosts
   link-scope address for which MLD messages are never sent.  Packets
   with the all hosts link-scope address should be forwarded on all
   ports.

留言

這個網誌中的熱門文章

scapy + python 好用的封包產生器,快速生成 udp packet

範例:  往 192.168.10.10 打 udp packet , src ip 是 192.168.1.0 .. 遞增 1024,UDP dest port 是 8001~8010, UDP src port  是 10001 ~ 10010, payload 是 'hello world',packet 從 eth0 出去 import struct, socket from scapy.all import *  #在這邊用  all 速度會變慢一些 ip2int = lambda ipstr: struct.unpack('!I', socket.inet_aton(ipstr))[0] int2ip = lambda n: socket.inet_ntoa(struct.pack('!I', n)) src_ip_base="192.168.1.0" src_ip_list=[ int2ip(a+ip2int("192.168.1.0")) for a in range(1024)] payload='hello world' packet=Ether(dst="00:e0:4c:68:00:66",src="00:1e:8c:74:b9:47")/ \        IP(dst="192.168.10.10",src=src_ip_list)/ \        UDP(sport=[i+10001 for i in range(10)],dport=[i+8001 for i in range(10)])/ \        payload sendp(packet,iface="eth0")

windows 上 wireshark 抓不到剛插入的 USB 網卡

有時後會遇到新插入 USB 網卡後,打開 Wireshark 沒看到這張網卡 https://osqa-ask.wireshark.org/questions/12192/usb-to-ethernet-adapter-doesnt-show-under-interfaces 根據這篇 wireshark 官網的連結,這是 windows 上的限制,通常是要 reboot 才會出現新網卡 可以試試看文章中下方提到的步驟 net stop npf net start npf tshark -D

利用 Bokeh + Python 速成網頁統計圖

最近剛好有需求在想要如何將透過 rest api get 回來的資料做成統計表 原本想從 Chrome plugin 找,不過似乎沒找到相關的工具 無意間發現這個 Bokeh 是個可以速成又簡單的工具 只要幾行 code ,就能畫出各種統計圖 <measurement> <server> 192.168.10.240 </server> <cpu> 0 </cpu> <memory> 75 </memory> </measurement> <measurement> <server> 192.168.10.131 </server> <cpu> 5 </cpu> <memory> 91 </memory> 原本透過 rest api get 的資料,在 Chrome 只能如上這樣顯示,看起來十分不清楚 經過處理後,可以直接輸出成 html ,並且顯示精美的統計圖 讓 web 前後端都沒碰過的我,也能夠方便的在 html 上產生這種統計圖 參考網址: Bokeh 官網 http://bokeh.pydata.org/en/latest/ Python 上前端!利用 Bokeh 與 Python 製作網頁互動視覺化 http://blog.infographics.tw/2016/04/interactive-visualization-with-bokeh-and-python/