瀏覽代碼

Add mcast notes

HON95 1 年之前
父節點
當前提交
f62d6a3ebb
共有 4 個文件被更改,包括 131 次插入9 次删除
  1. 1 0
      index.md
  2. 50 6
      networking/ipv4.md
  3. 2 3
      networking/ipv6.md
  4. 78 0
      networking/multicast.md

+ 1 - 0
index.md

@@ -129,6 +129,7 @@ Random collection of config notes and Miscellanea. _Technically not a wiki._
 - [Juniper SRX Series Firewalls](/networking/juniper-srx/)
 - [Linksys LGS Switches](/networking/linksys-lgs/)
 - [Linux Switching & Routing](/networking/linux/)
+- [Multicast](/networking/multicast/)
 - [Network Authentication](/networking/net-auth/)
 - [Open Shortest Path First (OSPF)](/networking/ospf/)
 - [pfSense](/networking/pfsense/)

+ 50 - 6
networking/ipv4.md

@@ -5,9 +5,9 @@ breadcrumbs:
 ---
 {% include header.md %}
 
-## Special Prefixes
+## Special Prefixes and Addresses
 
-|Prefix|Description|
+| Prefix | Description |
 |-|-|
 | `0.0.0.0/8` | Current network |
 | `10.0.0.0/8` | Private network |
@@ -26,6 +26,39 @@ breadcrumbs:
 | `240.0.0.0/4` | Reserved (formerly class E) |
 | `255.255.255.255/32` | Limited broadcast |
 
+### Multicast (Main)
+
+| Range | Description |
+|-|-|
+| `224.0.0.0/4` | Multicast range |
+| `224.0.0.0/24` | Local Network Control, for local router protocols, like OSPF, uses TTL=1 |
+| `224.0.1.0/24` | Internetwork Control, for global protocols, like NTP |
+| `224.0.2.0-224.0.255.255` | AD-HOC I, publicly routable and publicly assigned |
+| `224.1.0.0/16` | Reserved |
+| `224.2.0.0/16` | Session Description Protocol/Session Announcement Protocol (SDP/SAP) |
+| `224.3.0.0/15` | AD-HOC II, see block I |
+| `224.5.0.0-224.255.255.255` | Reserved |
+| `232.0.0.0/8` | SSM range, locally assigned |
+| `233.0.0.0-233.251.255.255` | GLOP, /24 blocks for 16-bit ASNs, experimental |
+| `233.252.0.0/14` | AD-HOC III, see block I |
+| `234.0.0.0-238.255.255.255` | Reserved |
+| `239.0.0.0/8` | Administratively scoped, for use within a private domain, like RFC 1918 |
+
+#### Multicast (Special)
+
+| Range | Description |
+|-|-|
+| `224.0.0.1` | All systems on this subnet |
+| `224.0.0.2` | All routers on this subnet |
+| `224.0.0.22` | IGMP |
+| `224.0.0.251` | mDNS |
+| `224.0.0.252` | LLMNR |
+
+### Special Addresses
+
+- The first address in a network is reserved for identifying the network and cannot be used by any hosts.
+- The last address in the network is reserved for directed broadcasts targeted at all hosts within the certain network. It it routable and frequently blocked by the last-hop router.
+
 ## Addressing
 
 ### Classful Routing
@@ -48,10 +81,21 @@ Originally the IPv4 address space was split into five classes with fixed, implic
 
 The terms are frequently interchanged and now typically used to refer to the same thing.
 
-### Special Addresses
+## Protocols
 
-- The first address in a network is reserved for identifying the network and cannot be used by any hosts.
-- The last address in the network is reserved for directed broadcasts targeted at all hosts within the certain network.
-  It it routable and frequently blocked.
+### Internet Group Messaging Protocol (IGMP)
+
+- For multicast cooordination between the host and the first-hop router.
+- Allows multicast listeners to _join_ and _leave_ multicast groups, and allows the router to query the listeners for group memberships.
+- IGMPv1 (RFC 1054):
+    - Mostly replaced by ICMPv2 and ICMPv3, rarely used.
+    - The querier queries all hosts at local address 224.0.0.1, and hosts respond.
+    - Hosts have no mechanism for leaving a group, other than waiting for the timeout. This can lead to being a member of a very large number of groups while "channel surfing".
+    - It has no querier election method, other than relying on PIM DR election.
+- IGMPv2 (RFC 2236):
+    - Adds a leave process, group queries, querier election (separated from DR election) and a maximum response time (MRT) field.
+    - Group queries are only sent to the specific groups and not all hosts.
+    - The maximum response time (MRT) is used in queries to inform hosts about how long the router will wait for a report. Hosts will wait a random amount of time less than the MRT and then sends a report if no other host has sent one yet. This reduces the amount of reports in the local network. IGMPv1 uses a hardcoded value of 10 seconds instead. The maximum configurable value is 25 seconds (255s/10). If the timer runs out on the router and no reports have been received, it informs PIM that there are no more listeners.
+- Configuration and commands: See [Multicast](../multicast/).
 
 {% include footer.md %}

+ 2 - 3
networking/ipv6.md

@@ -16,8 +16,6 @@ breadcrumbs:
 
 ## Special Prefixes and Addresses
 
-### Prefixes
-
 | Prefix | Scope | Description |
 | - | - | - |
 | `::/0` | | Default route |
@@ -41,7 +39,7 @@ breadcrumbs:
 
 See the [IANA IPv6 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml) for an updated table.
 
-### Multicasst addresses
+### Multicast
 
 | Prefix | Scope | Description |
 | - | - | - |
@@ -342,6 +340,7 @@ See the [IANA IPv6 Special-Purpose Address Registry](https://www.iana.org/assign
 - Multicast router discovery (MRD):
     - Based on MLD.
     - For discovery of multicast routers.
+- Configuration and commands: See [Multicast](../multicast/).
 
 ### Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
 

+ 78 - 0
networking/multicast.md

@@ -0,0 +1,78 @@
+---
+title: Multicast
+breadcrumbs:
+- title: Network
+---
+{% include header.md %}
+
+## Basics
+
+- Supports one-to-one, one-to-many, many-to-one and many-to-many communication. \*-to-many is generally the only useful variants, as \*-to-one is typically better solved using unicast.
+- Not natively supported on the Internet, mostly used within organisations and service providers only.
+- Typically uses UDP, as TCP handshakes won't work.
+- Any host can send multicast into the network without first declaring an intent to do so. The first-hop router will then create a multicast forwarding entry.
+- Receiving multicast generally requires "joining the group" first, so routers know where to forward it to.
+- Uses either any-source multicast (ASM) or source-specific multicsat (SSM).
+- Multicast entries are denoted using a _source comma group_ `(S, G)` entry for sender S and group G. With any-source multicast, a _star comma group_ `(*, G)` entry is used for lookups and will match any sender.
+- Whereas unicast uses a RIB and a FIB, multicast uses an MRIB and an MFIB.
+- Hosts on a network use Internet Group Messaging Protocol (IGMP) for IPv4 or Multicast Listener Discovery (MLD) for IPv6 toward the first-hop router to declare the interest in joining a multicast group (_joining_ and _leaving_). The router registers this in the MFIB and may use Protocol Independent Multicast (PIM) for IPv4 or PIM6 for IPv6 to forward the registration upstream.
+- Like other IP space, multicast IP space is managed by IANA.
+- _Replication_ is the process of duplicating a packet when it needs to be sent out of multiple interfaces.
+- Unlike an IP broadcast where the MAC address is the all-ones address, IP multicast is mapped to the MAC address range `01:00:5e:00:00:00-01:00:5e:7f:ff:ff` (25b). The lower 23 bits of the IP address is mapped to the lower 23 bits of the MAC address. Switches register this address range as multicast and floods it, while hosts can use the mapping for more efficient group filtering.
+
+### Address Space
+
+See the [IPv4](../ipv4/) and [IPv6](../ipv6/) pages.
+
+## Protocols
+
+### Internet Group Messaging Protocol (IGMP)
+
+- For cooordination between the host and the first-hop router.
+- See [IPv4](../ipv4/).
+
+### Multicast Listener Discovery (MLD)
+
+- For cooordination between the host and the first-hop router.
+- See [IPv6](../ipv6/).
+
+## Vendor Support
+
+### Cisco IOS XE
+
+#### Operational Commands
+
+- Routing:
+    - Show mcast routing table: `show {ip|ipv6} mroute [group]`
+- IGMP (IPv4):
+    - Show active groups: `show ip igmp groups`
+    - Show routed interface info: `show ip igmp interface <interface>`
+- MLD (IPv6):
+    - Show routed interface info: `show ipv6 mld interface <interface>`
+    - Show active groups (summary): `show ipv6 mld groups summary`
+    - Show active groups (detail): `show ipv6 mld groups [group-address] [interface <interface>] [detail]`
+
+#### Configuration
+
+- Enable multicast routing: `{ip|ipv6} multicast-routing`
+- IGMP (IPv4):
+    - Set query interval: `ip igmp query-interval [interval]` (seconds)
+        - Shows timers, version, DR, querier etc.
+    - Set query MRT: `ip igmp query-max-response-time [interval]` (seconds)
+    - Set query timeout, for querier election: `ip igmp query-timeout [interval]` (seconds)
+    - Set query count before group removal: `ip igmp last-member-query-count [count]` (1-7)
+        - Defaults to `ip igmp robustness`.
+    - Set the robustness (the number of expected packet drops): `ip igmp robustness <count>` (1-7)
+    - Set immediate-leave mode: `ip igmp immediate-leave [group-list <groups>]`
+        - Treats the interface as having only a single host, so leave messages causes the group to be removed from the interface immediately instead of querying a few times first.
+        - Use this on access ports.
+    - Show snooper info: `show ip igmp snooping <...>`
+- MLD (IPv6):
+    - Set query MRT: `ipv6 mld query-max-response-time [interval]` (seconds)
+    - **TODO**
+
+#### Resources
+
+- [Implementing IPv6 Multicast (Cisco Catalyst 9500)](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9500/software/release/16-8/configuration_guide/ipv6/b_168_ipv6_9500_cg/b_168_ipv6_9500_cg_chapter_010.pdf)
+
+{% include footer.md %}