140 likes | 278 Views
Multicast Source Filter API draft-ietf-idmr-msf-api-00.txt. Dave Thaler (Microsoft) Bill Fenner (AT&T Research) Bob Quinn (Stardust.com). Goals. Express multicast source filters for IPv4 and IPv6 Provide version-independent API not present in RFC 2553
E N D
Multicast Source Filter API draft-ietf-idmr-msf-api-00.txt Dave Thaler (Microsoft) Bill Fenner (AT&T Research) Bob Quinn (Stardust.com)
Goals • Express multicast source filters for IPv4 and IPv6 • Provide version-independent API not present in RFC 2553 • Basic (delta-based) version for most uses • Advanced version for large atomic operations, switching modes, etc. • Minimize changes to existing API
Existing IPv4 Multicast API struct ip_mreq { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */ }; socket options: IP_{ADD,DROP}_MEMBERSHIP
Semantics of Existing API • “Delta”-based • To join/leave a set of (sub)set of groups, call API once for each group to join or leave • NOT “final-state” based (don’t specify new set of groups to be joined to) • Often join multiple groups (e.g., different media), but this is not a problem
Structure for new IPv4 basic operations struct ip_mreq_source { struct in_addr imr_multiaddr; /* group address */ struct in_addr imr_sourceaddr;/* source address */ struct in_addr imr_interface; /* iface address*/ };
Socket Operations (setsockopt) • IP_{ADD,DROP}_SOURCE_MEMBERSHIP - for inclusion list changes • IP_{ADD,DROP}_MEMBERSHIP - existing API for exclude mode • IP_{ALLOW,BLOCK}_SOURCE - for exclusion list changes
Semantics of Basic API • For source-inclusion, just do IP_ADD_SOURCE_MEMBERSHIP per source • For source-exclusion, do IP_ADD_MEMBERSHIP, and IP_DROP_SOURCE_MEMBERSHIP per source • Functionally equivalent to abstract API • Always delta-based so more consistent with existing API
Advanced API • Basic API doesn’t let app switch modes without leaving group • Basic API is very inefficient with large source lists • Advanced API is final-state based: just set the complete filter
Structure for advanced IPv4 operations struct ip_msfilter { struct in_addr imsf_multiaddr; /* group address */ struct in_addr imsf_interface; /* iface address */ uint32_t imsf_fmode; /* filter mode */ uint32_t imsf_numsrc; /* # sources */ struct in_addr imsf_slist[1]; /* source list */ }; #define IP_MSFILTER_SIZE(numsrc) ... (size of buffer with numsrc sources in list) fmode=MCAST_{INCLUDE,EXCLUDE}
Socket Operations • setsockopt: • IP_MULTICAST_FILTER • ioctl: • SIO_GET_MULTICAST_FILTER • Open issue: change set to ioctl SIO_SET_MULTICAST_FILTER?
Protocol-Independent API • E.g. Resolve DNS name to sockaddr • Could be v4 or v6, want to use same API in spirit of RFC 2553 • Just need to use structures containing sockaddr_storage instead of addresses • Use indices to identify interfaces (not addresses!) as in current IPv6-specific API.
Basic Structures struct ip_mcast_req { uint32_t imr_interface; struct sockaddr_storage imr_group; }; struct ip_mcast_source_req { uint32_t imsr_interface; struct sockaddr_storage imsr_group; struct sockaddr_storage imsr_source; };
Advanced Structure struct ip_mcast_filter { uint32_t imf_interface; struct sockaddr_storage imf_group; uint32_t imf_fmode; uint32_t imf_numsrc; struct sockaddr_storage imf_slist[1]; }; #define IP_MCAST_FILTER_SIZE(numsrc) ... (size of buffer with numsrc sources)
Socket Operations • setsockopt: • IP_{JOIN,LEAVE}_GROUP • IP_{JOIN,LEAVE}_GROUP_SOURCE • IP_{BLOCK,ALLOW}_SOURCE • ioctl • SIO_{GET,SET}_MULTICAST_FILTER