Lab #12

Multicast transmission in a LAN

The purpose of this lab is to show how multicast IP works in a LAN context based on a switch device.

Preparation steps

This lab requires the GNS3 VM to instantiate a Docker container of a Linux-based multicast sender and receiver.
The procedure described here will be executed only once. Its purpose is to give GNS3 the ability to instantiate a Docker container of a Linux-based multicast sender and receiver. This component will be also used in further labs. This preparation step, however, will not be repeated.
Further information on the mcjoin container can be found in the troglobit/mcjoin repository on GitHub.
  1. In GNS3 go to Edit/Preferences... and select Docker container templates from the panel on the left of the Preferences window.
  2. Click on New.
  3. Select the Run this Docker container on the GNS3 VM option and press Next.
  4. Choose the New image action.
  5. Type troglobit/mcjoin:latest in the Image name textbox and press Next.
  6. Change the template name in mcjoin and press Next.
  7. Specify 1 as the number of adapters you want this container to use and click Next.
  8. Specify /bin/sh as the Start command textbox and click Next.
  9. Leave the console type set to telnet and click Next.
  10. Click Finish to complete this configuration process. dhcp-nat will now appear in the list of available Docker container templates.
Notice that the first time that the mcjoin component will be added to a GNS3 project, the Docker container image will be pulled from Docker Hub repository. This will require a few seconds.

mcjoin

mcjoin is a simple tool to test IPv4 and IPv6 multicast, featuring: mcjoin supports joining/sending to one or more groups: By default, with no options given, mcjoin acts as a multicast receiver (or sink), joining the default IPv4 group 225.1.2.3, listening on the default interface, eth0, binding to the default port, 1234.
To start sending UDP packets to an IP multicast group, the following command is to be issued on an auxiliary console of the mcjoin container:
# mcjoin -s <IPv4_or_IPv6_group_address>
Notice that if you try to send multicast IP packets from a container whose eth0 interface has not been configured with an IP address, you will get the following error message:
Interface eth0 has no IPv4 address yet.
To verify routing of multicast, make sure to add the -t TTL option to the sender since the default TTL is 1 and every router decrements the TTL.
The following picture shows the complete list of command line options for the mcjoin tool.
# mcjoin -h

Usage: mcjoin [-dhjosv] [-c COUNT] [-f MSEC] [-i IFACE] [-l LEVEL]
              [-p PORT] [-t TTL] [-w SEC]
              [[SOURCE,]GROUP0 .. [SOURCE,]GROUPN | [SOURCE,]GROUP+NUM]

Options:
  -b BYTES    Payload in bytes over IP/UDP header (42 bytes), default: 100
  -c COUNT    Stop sending/receiving after COUNT number of packets
  -d          Run as daemon in background, output except progress to syslog
  -f MSEC     Frequency, poll/send every MSEC milliseconds, default: 100
  -h          This help text
  -i IFACE    Interface to use for sending/receiving multicast, default: eth0
  -j          Join groups, default unless acting as sender
  -l LEVEL    Set log level; none, notice*, debug
  -o          Old (plain/ordinary) output, no fancy progress bars
  -p PORT     UDP port number to listen to, default: 1234
  -s          Act as sender, sends packets to select groups
  -t TTL      TTL to use when sending multicast packets, default 1
  -v          Display program version
  -w SEC      Initial wait before opening sockets
  -W SEC      Timeout, in seconds, before mcjoin exits

Bug report address : https://github.com/troglobit/mcjoin/issues
Project homepage   : https://github.com/troglobit/mcjoin/

Experiment steps

  1. Create the following topology in GNS3.
  2. lab-topology
  3. Right-click on mcjoin-1 and select "Edit config" to modify its network configuration to assign the 192.168.0.2 IP address to the eth0 interface with netmask 255.255.255.0.
    mcjoin-1-config
  4. Do the same for mcjoin-2 and mcjoin-3 to assign to their eth0 interfaces the IP addresses 192.168.0.3 and 192.168.0.4 (with netmask 255.255.255.0), respectively.
  5. Start all devices.
  6. Start capture on link connecting Switch1 to mcjoin-2.
  7. Click on mcjoin-2 and mcjoin-3 to open their Console terminal showing the ouptut of mcjoin command
  8. Right-click on mcjoin-1 and open an Auxiliary Console terminal and execute the following:

Traffic analysis

Output in mcjoin-1 terminal

lab2-pc1-terminal

Showing that mcjoin sent 37 multicast IP packets to group 225.1.2.3 before ctrl-c was pressed.

Output in mcjoin-2 and mcjoin-3 terminals

lab2-pc1-terminal

Showing that 37 multicast IP packets sent to group 225.1.2.3 were received by mcjoin-2 and mcjoin-3.

Output in Wireshark

lab12-wireshark

Wireshark shows a sequence of UDP packets sent by 192.168.0.2 (mcjoin-1) to the multicast IP group 225.1.2.3.

Notice that the MAC destination address for the Ethernet frames carrying the multicast IP packets sent to 225.1.2.3 is 01:00:5e:01:02:03.
This address is computed according to what is described in RFC-1112 (Section 6.4):.

An IP host group address is mapped to an Ethernet multicast address
by placing the low-order 23-bits of the IP address into the low-order
23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex).
Because there are 28 significant bits in an IP host group address,
more than one host group address may map to the same Ethernet
multicast address.
An IGMP snooping switch does not generate or respond to any multicast messages; instead it passively snoops on IGMP query, report, and leave (IGMP version 2) messages transferred between IP multicast routers/switches and IP multicast hosts to determine the multicast group membership.
Return to list of labs

Copyright (c) 2024 - Roberto Canonico

Last updated: 24/09/2024 by Roberto Canonico