title: Port-forwarding a Multicast IP
body: <p>I've spent some time learning about UDP connections, particularly with Multicast Sockets in Java.</p>
  
  <p>I was able to make a simple Multicast Socket "group chat" on my local network, but I've since been trying to expand this to work beyond my local network.</p>
  
  <p>In attempts to achieve this, I port-forwarded a Class D IP address on my router in order to allow other people to access my Multicast group from outside my network.</p>
  
  <p>However, when trying to connect to my "group chat" via my public IP and specified port (during the port-forwarding), I would receive the following error message...</p>
  
  <pre><code>Exception in thread "main" java.net.SocketException: Not a multicast address
  at java.net.MulticastSocket.joinGroup(MulticastSocket.java:310)
  ...
  </code></pre>
  
  <p>This error makes some sense, given that my public IP isn't a class D address. But since I port-forwarded a multicast address to the specified port on my router, shouldn't this problem not occur?</p>
  
  <p>Here's the relevant part of my code...</p>
  
  <pre><code>InetAddress group = InetAddress.getByName("192.___.___.___"); // my public IP
  MulticastSocket socket = new MulticastSocket(1234); // the port-forwarded port
  socket.joinGroup(group);
  </code></pre>
  
  <p>Where had I gone wrong here, and how could I get to fixing this issue?</p>