Menu
e-lo
  • Home
    • Tech
    • Inspiration and about
  • Database
    • T-SQL
    • SQL Server quick
    • SQL server docs
    • MySql quick sheet
    • Postgre
    • InfluxDB
  • Programming
    • Automating the boring stuff
    • Python 101
    • Python Docs
    • Python Logging
    • Powershell 4 lang ref
    • MS Azure PS
    • MS Azure Command-Line Interface (CLI) doc
  • Azure
    • AZ-104-MS Azure Administrator 101 quick ref
    • AZ-104 Lab
    • MS Windows virtual machines in Azure
    • MS ARM Docs
    • MS ARM Template Docs
    • MS ARM Tutorial
    • MS Deployment scripts (intern/extern)
    • ARM Quickstart
    • MS ARM templates 4h
  • Az Adm
    • AD 101
    • Governance and Compliance 102
    • Administration 103
    • Virtual Networking 104
    • Storage 107 (With table (NoSQL and more))
    • Virtual Machines 108
    • Azure Virtual Machines 101
    • Monitor VM (and market)
  • Linux
    • Top CMD’s
    • Useful CMD Linux
    • ss64 Linux
    • Ubuntu
    • 30 things Ubuntu 18.04
    • Bootable Ubuntu USB
    • LinuxFilesystemTreeOverview
  • Zen
    • Not thinking about anything is Zen
e-lo

Python multicasting UDP wireshark

Posted on November 18, 2018 by espenk

https://www.wireshark.org/

A multicast address is a logical identifier for a group of hosts in a computer network that are available to process datagrams or frames intended to be multicast for a designated network service. Multicast addressing can be used in the link layer (layer 2 in the OSI model), such as Ethernet multicast, and at the internet layer (layer 3 for OSI) for Internet Protocol Version 4 (IPv4) or Version 6 (IPv6) multicast.

 

Point-to-point connections handle a lot of communication needs, but passing the same information between many peers becomes challenging as the number of direct connections grows. Sending messages separately to each recipient consumes additional processing time and bandwidth, which can be a problem for applications such as streaming video or audio. Using multicast to deliver messages to more than one endpoint at a time achieves better efficiency because the network infrastructure ensures that the packets are delivered to all recipients.

Multicast messages are always sent using UDP, since TCP requires an end-to-end communication channel. The addresses for multicast, called multicast groups, are a subset of regular IPv4 address range (224.0.0.0 through 230.255.255.255) reserved for multicast traffic. These addresses are treated specially by network routers and switches, so messages sent to the group can be distributed over the Internet to all recipients that have joined the group.

Multicast groups is used for audio / multimedia, want to send same thing to a large group of people.

Multicastgroup is really just an IP, it just happens to fall in adr class of IP adr that indicats that is is a multicast adr.
We need to be able to multicast on port, and we use the AF_INET (Internet family), SOCK_DGRAM and specify socket.IPPROTO_UDP)

Lets verify this with wireshark.

import socket
mgrp = “224.1.1.2”
mport = 5555
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
for i in range(1, 3):
sock.sendto(b”This is a multicast messages to all who listen”, (mgrp, mport))
print(“Multicast msg sent”)
Now lets send some data and check it:
And there we have our multicast message in wireshark, great.

RSS Azure

  • Insights and best practices to run business-critical applications on Azure April 8, 2021

RSS Python

  • PEP 656: Platform Tag for Linux Distributions Using Musl March 17, 2021

Cloud

Ansible (1) ARM (7) azure (23) cmd (1) Django (4) Docker (1) e-lo (2) Flask (2) Github (9) Grafana (2) Information (1) Information Retrieval (12) JAVA (1) kivy (2) Kotlin (4) linux (13) mobile (2) Natural Language Prossesing (NLP) (2) Net.Core (1) Networking and Security (2) OPC (2) PEP8 (1) Philosophy (3) Python (42) Python Networking and Security (2) Reason (2) RMQ (2) Solr (11) Sql (10) VSC (1) Warframe (2) WMVARE (4) Zabbix (7)

Recent Posts

  • TODO Ubuntu Ubuntu 20.04.2 LTS and Bash
  • Disk measurements with typeperf (Pandas py)
  • 2 TODO Azure, Arm and Bash
  • Cryptography with Python – Caesar Cipher
  • 1 TODO Udemy AZ-104 Microsoft Azure Administrator Exam Certification (Scott Duffy)

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2021 e-lo | Powered by WordPress & Superb Themes