IP Multicast

From Teknologisk videncenter
Revision as of 08:20, 27 February 2009 by Heth (talk | contribs) (IGMP Version 2)
Jump to: navigation, search

Architecture

A network designed to deliver a multicast service (like video) using IGMP might use this basic architecture:

Multicast Architecture showing PIM and IGMP

IGMP is used both by the client computer and the adjacent network switches to connect the client to a local multicast router. Protocol Independent Multicast (PIM) is then used between the local and remote multicast routers, to direct multicast traffic from the video server to many multicast clients.

Multicast Applications

One-to-Many

where one sender sends data to many receivers.

  • This type of application may be used for audio or video distribution, push media, announcements, monitoring, and so on.
  • If a one-to-many application needs feedback from receivers, it becomes a many-to-many application

Many-to-Many

where a host can be a sender and a receiver simultaneously or where two or more receivers also act as senders.

  • Receiving data from several sources increases the complexity of applications and creates different management challenges.
  • Using a many-to-many multicast concept as a foundation, a whole new range of applications may be built (for example, collaboration, concurrent processing, and distributed interactive simulations).

Many-to-One

where many receivers are sending data back to one sender.

  • Used by financial applications and networks. Other uses include resource discovery, data collection, auctions, and polling.

IP multicast Addresses

IP Multicast addresses ranging from from 224.0.0.0 to 239.255.255.255 are divided into three multicast address groups.

IPv4 Multicast Address groups
From to Range
224.0.0.0 224.0.0.255 Reserved link, Local addresses
224.0.1.0 238.255.255.255 Globally scoped addresses
239.0.0.0 239.255.255.255 Limited Scope addresses

Locally scoped (reserved link local) addresses

  • Reserved by the Internet Assigned Numbers Authority (IANA) for network protocol use.
  • Address range is from 224.0.0.0 through 224.0.0.255.
  • Multicasts in this range are never forwarded off the local network, regardless of Time to Live (TTL). Usually, the TTL is set to 1.
Some local Scope Multicast addresses
Address Meaning
224.0.0.1 All multicast Systems on a subnet
224.0.0.2 All multicast Routers on a subnet
224.0.0.4 All Distant vector multicast routing protocol routers
224.0.0.5 All OSPF Routers
224.0.0.6 All OSPF designated Routers
224.0.0.9 All RIPv2 Routers
224.0.0.10 All EIGRP Routers
224.0.0.13 All PIMv2 Routers

Globally scoped addresses

  • Allocated dynamically throughout the Internet.
  • Address range is from 224.0.1.0 through 238.255.255.255.
  • The 224.2.X.X range is used in Multicast Backbone (Mbone) applications. Established by the Internet Engineering Task Force (IETF) to multicast audio and video meetings, Mbone is a collection of Internet routers that support IP multicasting on which various public and private audio and video programs are sent.

Limited (administratively) scoped addresses

  • Reserved for use inside private domains. Similar to the private IP address space that is used within the boundaries of a single organization, limited or administratively scoped addresses are constrained to a local group or organization.
  • Address range is from 239.0.0.0 through 239.255.255.255.
  • Organizations can use limited scope addresses to have local multicast applications that will not be forwarded over the Internet.
  • Within an autonomous system or domain, the limited scope address range can be further subdivided so that local multicast boundaries can be defined. This subdivision is called address scoping and allows for address reuse between smaller domains. The administratively scoped multicast address space is divided into the following scopes:
  • Organization-local scope (239.192.0.0 to 239.251.255.255)
  • Site-local scope (239.255.0.0/16, with 239.252.0.0/16, 239.253.0.0/16, and 239.254.0.0/16 also reserved)

Layer 2 Multicast addressing

IP Multicast MAC address mapping on Ethernet

On Ethernet the IP multicast address is converted to a Ethernet Multicast address.

  • IPv4 addresses are 32 bits wide.
  • Ethernet MAC Addresses are 48 bits wide.

Because the IP address are shorter than the MAC address a direct conversion is not possible.

Conversion from multicast IPv4 to MAC Address

How does a router or a switch relate a multicast IP address with a MAC address? Normally, network interface cards (NICs) on a LAN segment only receive packets destined for their burned-in MAC address. However, there is no Address Resolution Protocol (ARP) equivalent for multicast address mapping.

Instead, IANA has set aside the vendor code portion of the reserved Organizationally Unique Identifier (OUI) value to identify multicast MAC addresses. Multicast MAC addresses always begin with the low-order bit (0x01) in the first octet. Specifically, the 0x01005e prefix (plus the next lower bit, which is zero) has been reserved for mapping Layer 3 IP multicast addresses into Layer 2 MAC addresses. The complete multicast MAC address range is from 0100.5e00.0000 through 0100.5e7f.ffff.

This makes the first 25 bits of the MAC address fixed (24 bits plus the zero bit) and allows for the last 23 bits of the MAC address to correspond to the last 23 bits in the IP multicast group address. The translation between IP multicast and MAC address is achieved by the mapping of the low-order 23 bits of the IP (Layer 3) multicast address into the low-order 23 bits of the IEEE (Layer 2) MAC address.

There are 28 bits of unique address space for an IP multicast address (32 minus the first four bits containing the 1110 Class D prefix), and there are only 23 bits mapped into the IEEE MAC address. Therefore, five bits of the IP address are unused and not transferred into the MAC address, which means that there are five bits of overlap.

The result is that two (or more) different IP multicast addresses may map to the same MAC multicast address. For example, 224.1.1.1 and 225.1.1.1 map to the same multicast MAC address. If one user subscribed to Group A (as designated by 224.1.1.1) and the other user subscribed to Group B (as designated by 225.1.1.1), they would both receive both A and B streams at Layer 2. At Layer 3, however, only the packets associated with the IP address of the selected multicast group would be viewable, because the port ranges used within the address is different between aliased streams.

This gives the possibility that 32 different multicast IP addresses could all correspond to a single multicast MAC address. For example, all the IP multicast addresses in Figure map to the same Layer 2 multicast of 01-00-5e-0a-00-01.

Network administrators should consider this when assigning IP multicast addresses.

IGMP

Internet Group Management Protocol (IGMP)
IGMP is a host-to-router protocol used when hosts want to join a multicast group. With IGMPv1, routers send periodic membership queries to the multicast address 224.0.0.1. Hosts send membership reports to the group multicast address they want to join. Hosts silently leave the multicast group.

  • IGMP has evolved through three versions (1, 2, and 3).
  • Understanding this protocol is fundamental in defining the multicast group membership join and leave process, which is a required function of multicasting.

IGMP Version 1

RFC 1112, Host Extensions for IP Multicasting, describes the specification for IGMP Version 1 (IGMPv1). A diagram of the packet format for an IGMPv1 message is shown in Figure 5. Figure 5 IGMPv1 Message Format In Version 1, only the following two types of IGMP messages exist:

  • Membership query
  • Membership report
Defined by RFC 1112
IGMPv1 packet
Bits 0 - 3 4 - 7 8 - 15 16 - 23 24 - 31
0 Version Type Unused Checksum
32 Group Address

Hosts send out IGMP membership reports corresponding to a particular multicast group to indicate that they are interested in joining that group. The TCP/IP stack running on a host automatically sends the IGMP Membership report when an application opens a multicast socket. The router periodically sends out an IGMP membership query to verify that at least one host on the subnet is still interested in receiving traffic directed to that group. When there is no reply to three consecutive IGMP membership queries, the router times out the group and stops forwarding traffic directed toward that group.

IGMP Version 2

IGMPv1 has been superceded by IGMP Version 2 (IGMPv2), which is now the current standard. IGMPv2 is backward compatible with IGMPv1. RFC 2236, Internet Group Management Protocol, Version 2, describes the specification for IGMPv2. A diagram of the packet format for an IGMPv2
In Version 2, the following four types of IGMP messages exist:

  • Membership query
  • Version 1 membership report
  • Version 2 membership report
  • Leave group
Defined by RFC 2236
IGMPv2 packet
+ Bits 0 - 7 8 - 15 16 - 23 24 - 31
0 Type Max Resp Time Checksum
32 Group Address

IGMP Version 2 works basically the same way as Version 1. The main difference is that there is a leave group message. With this message, the hosts can actively communicate to the local multicast router that they intend to leave the group. The router then sends out a group-specific query and determines if any remaining hosts are interested in receiving the traffic. If there are no replies, the router times out the group and stops forwarding the traffic. The addition of the leave group message in IGMP Version 2 greatly reduces the leave latency compared to IGMP Version 1. Unwanted and unnecessary traffic can be stopped much sooner.