Name: nt126004 Date: 12/09/2002
FULL PRODUCT VERSION :
java -version
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
FULL OPERATING SYSTEM VERSION : Suse 8.0 Linux 2.4.18
EXTRA RELEVANT SYSTEM CONFIGURATION :
2 Ethernet interfaces
eth0 -> 192.168.1.11/24
eth1 -> 192.168.2.104/24
A DESCRIPTION OF THE PROBLEM :
Basically a multicast socket is created and bound to 2
different IP addresses using 'socket.setInterface', but the
multicasts are coming out the same interface and TTL is 1
even though it is set up 10.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.java Mxmit 239.192.101.100 11000 10 192.168.2.104
2.java Mxmit 239.192.100.100 11000 10 192.168.1.11
EXPECTED VERSUS ACTUAL BEHAVIOR :
The expected results are that there will be multicast stream
on eth1 interface also.
netstat -g reports
eth0 1 239.192.100.100
eth1 1 239.192.101.100
netstat -rn reports
192.168.2.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0
224.0.0.0 0.0.0.0 240.0.0.0 U 40 0 0 eth0
224.0.0.0 0.0.0.0 240.0.0.0 U 40 0 0 eth1
0.0.0.0 192.168.1.1 0.0.0.0 UG 40 0 0 eth0
ERROR MESSAGES/STACK TRACES THAT OCCUR :
tcpdump reports both streams coming out the eth0 interface.
17:46:53.032452 192.168.1.11.11000 > 239.192.100.100.11000: udp 31 (DF) [ttl 1]
17:46:54.602099 192.168.1.11.12000 > 239.192.101.100.12000: udp 30 (DF) [ttl 1]
17:46:58.041458 192.168.1.11.11000 > 239.192.100.100.11000: udp 31 (DF) [ttl 1]
17:46:59.612518 192.168.1.11.12000 > 239.192.101.100.12000: udp 30 (DF) [ttl 1]
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Mxmit.java
import java.net.*;
import java.io.*;
import java.lang.*;
import java.util.*;
import java.text.DateFormat;
class Mxmit {
public static void main( String[] args) {
if ( args.length != 4) {
System.err.println(" Syntax -> java Mxmit <address/group> <port> <ttl>
<hostIP>");
System.exit(-1);
}
int delta = Integer.parseInt(args[2]);
try {
int port = Integer.parseInt(args[1]);
MulticastSocket socket = new MulticastSocket(port);
InetAddress group = InetAddress.getByName(args[0]);
InetAddress local = InetAddress.getByName(args[3]);
System.out.println( local );
socket.setInterface(local);
socket.joinGroup(group);
System.out.println(local);
socket.setTimeToLive(delta);
System.out.println("TTL -> " + socket.getTimeToLive());
Date today = new Date();
String ok = DateFormat.getDateInstance().format(today);
System.out.println(ok);
System.out.println(today);
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String cmd, send;
int counter = 0;
while (true) {
send = new Date() + " " + String.valueOf( counter );
DatagramPacket packet = new DatagramPacket(send.getBytes(),
send.length(), group, port);
socket.send(packet);
Thread.sleep(5000);
counter++;
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
I will have to continue to try to make stream come out eth1
interface.
(Review ID: 178881)
======================================================================
- duplicates
-
JDK-4742177 Re-test IPv6 (and specifically MulticastSocket) with latest Linux & USAGI code
- Closed