Skip to content

Commit

Permalink
Merge branch 'change_mcast' of https://github.com/diegolovison/JGroups
Browse files Browse the repository at this point in the history
…into diegolovison-change_mcast
  • Loading branch information
belaban committed Jul 29, 2022
2 parents 4b4ad17 + 50b1090 commit 18d5541
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion build.properties.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
jgroups.bind_addr=localhost
jgroups.tcpping.initial_hosts=localhost[7800],localhost[7801]
jgroups.tunnel.gossip_router_hosts=localhost[12001]
jgroups.udp.mcast_addr=228.8.8.8
jgroups.udp.mcast_addr=239.8.8.8
jgroups.udp.mcast_port=45588
jgroups.udp.ip_ttl=5
# use true for IPv6 and false for IPv4
Expand Down
4 changes: 2 additions & 2 deletions doc/design/NIO2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Gathering writes and scattering reads are not supported in DatagramChannel
support for gathering writes and scattering reads

- UPDATE: gathering writes can be supported by simply connecting to the multicast address, e.g.
DatagramChannel.connect(new InetAddress.getByName("232.5.5.5"));
- On the receiver side, we cannot connect to 232.5.5.5, as the senders' address will be the individual IP addresses
DatagramChannel.connect(new InetAddress.getByName("239.5.5.5"));
- On the receiver side, we cannot connect to 239.5.5.5, as the senders' address will be the individual IP addresses
- May not an issue as we may not have to do scattering reads on the receiver side...
- This doesn't work for sending and receiving *unicasts*, as we'll need to able to send / receive unicasts
to / from different destinations using the same datagram socket
Expand Down
16 changes: 8 additions & 8 deletions doc/manual/advanced.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ NOTE: Probe by default uses IP multicasting to send probe requests to all cluste
sends the request to all members individually.
The way probe works is that every stack has an additional multicast socket that by default listens
on 224.0.75.75:7500 for diagnostics requests from probe. The configuration is located in the transport
on 239.0.75.75:7500 for diagnostics requests from probe. The configuration is located in the transport
protocol (e.g. UDP), and consists of the following properties:
Expand All @@ -1803,7 +1803,7 @@ The way probe works is that every stack has an additional multicast socket that
|diag_enable_tcp|Use a TCP socket to listen for probe requests (ignored if `enable_diagnostics` is false)
|diagnostics_addr| The multicast address which the MulticastSocket should join. The default is
`224.0.75.75` for IPv4 and `ff0e::0:75:75` for IPv6.
`239.0.75.75` for IPv4 and `ff0e::0:75:75` for IPv6.
|diagnostics_bind_addr|Bind address for diagnostic probing. Used when diag_enable_tcp is true")
Expand All @@ -1824,7 +1824,7 @@ To get information about the cluster members running in the local network, we ca
[belasmac] /Users/bela$ probe.sh
-- sending probe on /224.0.75.75:7500
-- sending probe on /239.0.75.75:7500
#1 (100 bytes):
Expand Down Expand Up @@ -1868,7 +1868,7 @@ However, we can also JMX information from a specific protocol, e.g. FRAG2 (sligh
[linux]/home/bela$ probe.sh jmx=FRAG2
-- send probe on /224.0.75.75:7500
-- send probe on /239.0.75.75:7500
#1 (318 bytes):
Expand Down Expand Up @@ -1911,7 +1911,7 @@ We can also get information about specific properties in a given protocol:
[belasmac] /Users/bela$ probe.sh jmx=NAKACK2.xmit
-- sending probe on /224.0.75.75:7500
-- sending probe on /239.0.75.75:7500
#1 (597 bytes):
Expand All @@ -1938,7 +1938,7 @@ all cluster members. We can also pass a list of attributes:
----
[belasmac] /Users/bela$ probe.sh jmx=NAKACK2.xmit,num
-- sending probe on /224.0.75.75:7500
-- sending probe on /239.0.75.75:7500
#1 (646 bytes):
Expand Down Expand Up @@ -1994,7 +1994,7 @@ To get RPC stats, `rpcs` and `rpcs-details` can be used:
----
[belasmac] /Users/bela/JGroups$ probe.sh rpcs rpcs-details
-- sending probe on /224.0.75.75:7500
-- sending probe on /239.0.75.75:7500
#1 (481 bytes):
local_addr=C [ip=127.0.0.1:55535, version=3.6.8-SNAPSHOT, cluster=uperf, 4 mbr(s)]
uperf: sync multicast RPCs=0
Expand Down Expand Up @@ -2094,7 +2094,7 @@ binding to the loopback (127.0.0.1) device and ports starting from 7800, the fol
<config>
<UDP
bind_addr="127.0.0.1" bind_port="7800"
mcast_addr="228.2.2.2"
mcast_addr="239.2.2.2"
mcast_port="${jgroups.udp.mcast_port:45588}">
...
</config>
Expand Down
6 changes: 3 additions & 3 deletions doc/manual/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ Sometimes there isn't a network connection (e.g. DSL modem is down), or we want
For this the loopback interface (typically lo) can be configured, e.g.

....
route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
route add -net 239.0.0.0 netmask 240.0.0.0 dev lo
....

This means that all traffic directed to the `224.0.0.0` network will be sent to the loopback interface, which means it
doesn't need any network to be running. Note that the `224.0.0.0` network is a placeholder for all multicast addresses
This means that all traffic directed to the `239.0.0.0` network will be sent to the loopback interface, which means it
doesn't need any network to be running. Note that the `239.0.0.0` network is a placeholder for all multicast addresses
in most UNIX implementations: it will catch _all_ multicast traffic.

The above instructions may also work for Windows systems, but this hasn't
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/protocols.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ address chosen will be:
| jgroups.name_cache.max_age | The max age (in milliseconds) a mapping between address and logical name is kept in the
NameCache. Not that elements are only evicted if there's not enough room.
| jgroups.ipmcast.prefix | Needed if an IPv4 multicast address is used in an IPv6 system. The prefix (default: `ff0e::`)
will prefix the IPv4 multicast address, e.g. `232.5.5.5` -> `ff0e::232.5.5.5`
will prefix the IPv4 multicast address, e.g. `239.5.5.5` -> `ff0e::239.5.5.5`
| jgroups.use.jdk_logger | If true, the JDK logger (`java.util.logging.Logger`) will be used
| jgroups.log_class | The fully qualified name of a class implementing a logger to be used. See <<Logging>> for details.
| jgroups.msg.default_headers | System prop for defining the default number of headers in a Message (default: 4).
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ You should again see 2 instances of Draw which form a cluster. If this is not th
have to add a multicast route to the loopback device (this requires superuser or admin privileges):

----
route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
route add -net 239.0.0.0 netmask 240.0.0.0 dev lo
----

This means that all traffic directed to the 224.0.0.0 network will be sent to the loopback interface,
This means that all traffic directed to the 239.0.0.0 network will be sent to the loopback interface,
which means it doesn't need any network to be running.

Typical home networks have a gateway/firewall with 2 NICs: the first (`eth0`) is connected to the outside
Expand Down
2 changes: 1 addition & 1 deletion src/org/jgroups/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public final class Global {
public static final int MAX_DATAGRAM_PACKET_SIZE=1 << 16;
public static final Address NULL_ADDRESS=new UUID(0,0);

public static final String DEFAULT_DIAG_ADDR="224.0.75.75";
public static final String DEFAULT_DIAG_ADDR="239.0.75.75";
public static final String DEFAULT_DIAG_ADDR_IPv6="ff0e::0:75:75";

public static final String IPv4="java.net.preferIPv4Stack";
Expand Down
2 changes: 1 addition & 1 deletion src/org/jgroups/demos/ProgrammaticChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static void main(String[] args) throws Exception {

InetAddress ba=bind_addr == null? Util.getAddress("site_local", Util.getIpStackType())
: InetAddress.getByName(bind_addr);
InetAddress diag_addr=Util.getAddress("224.0.75.75", Util.getIpStackType());
InetAddress diag_addr=Util.getAddress("239.0.75.75", Util.getIpStackType());
InetAddress mping_mcast=Util.getAddress("230.5.6.7", Util.getIpStackType());
ProtocolStack stack=ch.getProtocolStack();
TP transport=stack.getTransport().setBindAddress(ba);
Expand Down
4 changes: 2 additions & 2 deletions src/org/jgroups/protocols/UDP.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* <p>
* The following properties are read by the UDP protocol:
* <ul>
* <li> param mcast_addr - the multicast address to use; default is 228.8.8.8.
* <li> param mcast_addr - the multicast address to use; default is 239.8.8.8.
* <li> param mcast_port - (int) the port that the multicast is sent on; default
* is 7600
* <li> param ip_mcast - (boolean) flag whether to use IP multicast; default is
Expand Down Expand Up @@ -68,7 +68,7 @@ public class UDP extends TP {
protected static final String MCAST_NAME="mcast-receiver";

@Property(name="mcast_addr", description="The multicast address used for sending and receiving packets",
defaultValueIPv4="228.8.8.8", defaultValueIPv6="ff0e::8:8:8",
defaultValueIPv4="239.8.8.8", defaultValueIPv6="ff0e::8:8:8",
systemProperty=Global.UDP_MCAST_ADDR,writable=false)
protected InetAddress mcast_group_addr;

Expand Down
2 changes: 1 addition & 1 deletion src/org/jgroups/stack/DiagnosticsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class DiagnosticsHandler extends ReceiverAdapter implements Closeable {
protected volatile boolean enable_tcp;

@Property(description="Multicast address for diagnostic probing (UDP MulticastSocket). Used when enable_udp " +
"is true", defaultValueIPv4="224.0.75.75",defaultValueIPv6="ff0e::0:75:75")
"is true", defaultValueIPv4="239.0.75.75",defaultValueIPv6="ff0e::0:75:75")
protected InetAddress mcast_addr;

@Property(description="Port for diagnostic probing. Default is 7500")
Expand Down
4 changes: 2 additions & 2 deletions src/org/jgroups/util/ResourceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public final class ResourceManager {
StackType type=Util.getIpStackType();

String tmp_addr = SecurityActions.getProperty(Global.INITIAL_MCAST_ADDR,
type == StackType.IPv6? "ff0e::9:9:9" : "228.8.8.8");
type == StackType.IPv6? "ff0e::9:9:9" : "239.8.8.8");
mcast_port = Short.parseShort(SecurityActions.getProperty(Global.INITIAL_MCAST_PORT, "7000"));
tcp_port = Short.parseShort(SecurityActions.getProperty(Global.INITIAL_TCP_PORT, "10000"));
try {
Expand All @@ -47,7 +47,7 @@ private ResourceManager() {
}

/**
* Returns the next available multicast address, e.g. "228.1.2.3". This
* Returns the next available multicast address, e.g. "239.1.2.3". This
* class is a JVM singleton
*
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void setUp() throws Exception {
e=new IpAddress("127.0.0.1", 5555);
f=new IpAddress("www.ibm.com", 80);
g=new IpAddress("www.ibm.com", 8080);
h=new IpAddress("224.0.0.1", 5555);
h=new IpAddress("239.0.0.1", 5555);
}
c=b;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/junit-functional/org/jgroups/tests/Relay2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ protected static RELAY2 createRELAY2(String site_name) throws UnknownHostExcepti
protected static Protocol[] createBridgeStack() throws UnknownHostException {
return new Protocol[] {
new TCP().setBindAddress(LOOPBACK),
new MPING().setMcastAddr(InetAddress.getByName("228.9.9.9")),
new MPING().setMcastAddr(InetAddress.getByName("239.9.9.9")),
new MERGE3().setMaxInterval(3000).setMinInterval(1000),
new NAKACK2().useMcastXmit(false),
new UNICAST3(),
Expand Down
2 changes: 1 addition & 1 deletion tests/other/org/jgroups/tests/McastDiscovery.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void sendDiscoveryRequest() {

public static void main(String[] args) {
int ttl = 32; // ttl to use for IP mcast packets
String mcast_addr = "228.8.8.8"; // multicast address to use
String mcast_addr = "239.8.8.8"; // multicast address to use
int mcast_port = 5000; // port to use for mcast socket
long interval = 2000; // time between mcast requests

Expand Down
2 changes: 1 addition & 1 deletion tests/other/org/jgroups/tests/McastReceiverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void main(String[] args) {
return;
}
if(mcast_addr == null)
mcast_addr=InetAddress.getByName("224.0.0.150");
mcast_addr=InetAddress.getByName("239.0.0.150");
}
catch(Exception ex) {
System.err.println(ex);
Expand Down
2 changes: 1 addition & 1 deletion tests/other/org/jgroups/tests/McastSenderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void main(String[] args) {
return;
}
if(mcast_addr == null)
mcast_addr=InetAddress.getByName("224.0.0.150");
mcast_addr=InetAddress.getByName("239.0.0.150");
}
catch(Exception ex) {
System.err.println(ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


/**
Listens on 224.0.1.105:23364 for mod-cluster advertizements from httpd daemons and prints them to stdout
Listens on 239.0.1.105:23364 for mod-cluster advertizements from httpd daemons and prints them to stdout
@author Bela Ban
@version $Revision: 1.1 $
*/
Expand Down Expand Up @@ -50,7 +50,7 @@ public static void main(String[] args) {
return;
}
if(mcast_addr == null)
mcast_addr=InetAddress.getByName("224.0.1.105");
mcast_addr=InetAddress.getByName("239.0.1.105");
}
catch(Exception ex) {
System.err.println(ex);
Expand Down
2 changes: 1 addition & 1 deletion tests/other/org/jgroups/tests/MulticastTest2.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class MulticastTest2 {

static {
try {
MCAST_ADDR=InetAddress.getByName("228.8.8.8");
MCAST_ADDR=InetAddress.getByName("239.8.8.8");
BIND_ADDR=InetAddress.getLocalHost();
}
catch(UnknownHostException e) {
Expand Down
2 changes: 1 addition & 1 deletion tests/other/org/jgroups/tests/mcast.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static void main(String[] args) throws Exception {
switch(ip_version) {
case IPv4:
case Dual:
mcast_addr=InetAddress.getByName("232.5.5.5");
mcast_addr=InetAddress.getByName("239.5.5.5");
break;
case IPv6:
mcast_addr=InetAddress.getByName("ff0e::8:8:8");
Expand Down
4 changes: 2 additions & 2 deletions tests/perf/org/jgroups/tests/perf/ProgrammaticUPerf.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void init(String name, AddressGenerator generator, String bind_addr, int

if(udp) {
UDP u=new UDP().setMulticastAddress(InetAddress.getByName(mcast_addr)).setMulticastPort(mcast_port);
u.getDiagnosticsHandler().setMcastAddress(InetAddress.getByName("224.0.75.75")).enableUdp(true);
u.getDiagnosticsHandler().setMcastAddress(InetAddress.getByName("239.0.75.75")).enableUdp(true);
prot_stack[0]=u;
prot_stack[1]=new PING();
}
Expand Down Expand Up @@ -631,7 +631,7 @@ private void pickAnycastTargets(List<Address> anycast_targets) {


public static void main(String[] args) throws Exception {
String name=null, bind_addr=null, mcast_addr="232.4.5.6";
String name=null, bind_addr=null, mcast_addr="239.4.5.6";
boolean run_event_loop=true;
AddressGenerator addr_generator=null;
int port=7800, mcast_port=45566;
Expand Down
2 changes: 1 addition & 1 deletion tests/perf/org/jgroups/tests/perf/ProgrammaticUPerf2.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ProgrammaticUPerf2 implements Receiver {
private static final JChannel channel;
private static final RpcDispatcher disp;
private static final String BIND_ADDR="site_local";
private static final String MCAST_ADDR="232.5.5.5";
private static final String MCAST_ADDR="239.5.5.5";
private static Address local_addr=null;
protected static final List<Address> members=new ArrayList<>();
protected static volatile View view=null;
Expand Down
2 changes: 1 addition & 1 deletion tests/perf/org/jgroups/tests/perf/UdpPerf.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void start() throws Exception {
System.out.println(sb);

mcast_sock=new MulticastSocket(7500);
sock_addr=new InetSocketAddress(InetAddress.getByName("232.5.5.5"), 7500);
sock_addr=new InetSocketAddress(InetAddress.getByName("239.5.5.5"), 7500);
mcast_sock.joinGroup(sock_addr, null);
mcast_sock.setReceiveBufferSize(10 * 1000 * 1000);
mcast_sock.setSendBufferSize(5 * 1000 * 1000);
Expand Down

0 comments on commit 18d5541

Please sign in to comment.