Skip to main content

IGMPv2 router-side protocol implementation for Python

Project description

IGMP

PyPI - Python Version PyPI PyPI - License

This repository stores the implementation of IGMPv2 router-side state machines. This can be used to detect multicast interest of directly connected hosts.

The goal of this repository/module is to facilitate maintainability of this IGMP implementation since its code is used by other Python projects/modules:

This implementation was performed during my Master thesis and has since then been updated to fix issues, add new features and in the future to include the implementation of IGMPv3 as well.

Documents detailing the initial work of IGMPv2 implementation

Requirements

  • Linux machine
  • Python3 (we have written all code to be compatible with at least Python v3.2)
  • pip (to install all dependencies)

Installation

pip3 install igmp

How to use it?

# import module
from igmp import InterfaceIGMP

intf = InterfaceIGMP(interface_name="eth0")
intf.enable()  # start receiving igmp packets

# get information from a given multicast group
multicast_group_obj = intf.interface_state.get_group_state(group_ip="224.10.11.12")

interest = multicast_group_obj.has_members()  # boolean that informs if there is
                                              # multicast interest in this group
group_state = multicast_group_obj.state.print_state()  # get string identifying
                                                       # the state in which this
                                                       # group is at

# get notified of interest changes on this group
class MulticastGroupNotifier:
    def notify_membership(self, has_members):
        print(has_members)

notifier = MulticastGroupNotifier()
multicast_group_obj.add_multicast_routing_entry(notifier)

# when there is a change of multicast interest (for example group 224.10.11.12
# gets interested receivers), the object associated to this object is notified
# through "notify_membership" method with has_members=True

# if you no longer want to monitor the interest of 224.10.11.12, remove the
# notifier from the group
multicast_group_obj.remove_multicast_routing_entry(notifier)

intf.remove()  # stop receiving igmp packets

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

igmp-1.0.4.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

igmp-1.0.4-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file igmp-1.0.4.tar.gz.

File metadata

  • Download URL: igmp-1.0.4.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for igmp-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d4497f4ee19c8e9d4ca46fb919e72e83ed4ddf193ff47ed8e842ca2afe1a537c
MD5 5f8cc96363a01d9a76210a16e381a283
BLAKE2b-256 16c547ace7e4cbd8736692a6a4bd79a3851ea3aac9ea55021e3e894ad19da023

See more details on using hashes here.

File details

Details for the file igmp-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: igmp-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for igmp-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 84a9d0cb7831a12ced6b6a82fccac248dfb7ab7c016ad3279165d144fabb4dfa
MD5 6d1d3730f244e34e115f5c8838a8da84
BLAKE2b-256 f561e6f748d8b9eaf2c006078530b1c6e49cec2794bdc2e346f468f0c72586d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page