DatagramSocket not picking up UDP broadcasts

Hi All.
Opened a DatagramSocket on specific port. Verfied (w/ tcpdump) that other process is sending UDP packets to that port with broadcast address (128.0.3.255). {pseudocode}DatagramSocket.recieve(dgram) never picks up the packets.
If I change the sender to use specific IP (unicast), the recieve gets the packet and unblocks.
JRE1_5
Any ideas?
-K

Are you binding the socket to the wildcard address?
Is that really your broadcast address? The 128.0.0.0/16 address block is slightly unusual (RFC 3330). broadcast = ip_address | ~netmask; (or use 255.255.255.255).
Try these programs; do they work for you? If they do, what is different between these and your program:
import java.io.*;
import java.net.*;
public class BroadcastSend
    public static void main(String args[])
     throws Exception
     DatagramSocket socket = new DatagramSocket();
     socket.setBroadcast(true);
     socket.setReceiveBufferSize(64 * 1024);
     socket.setSendBufferSize(64 * 1024);
     int str_size = args.length == 0 ? 256 : Integer.parseInt(args[0]);
     StringBuffer str = new StringBuffer();
     while (str.length() < str_size)
         str.append("hello world");
     str.setLength(str_size);
     byte buf[] = str.toString().getBytes("ISO-8859-1");
     InetAddress address = InetAddress.getByName("255.255.255.255");
     DatagramPacket packet = new DatagramPacket(buf, buf.length, address, 6666);
     socket.send(packet);
import java.io.*;
import java.net.*;
public class BroadcastReceive
    public static void main(String args[])
     throws Exception
     DatagramSocket socket = new DatagramSocket(6666);
     socket.setBroadcast(true);
     socket.setReceiveBufferSize(64 * 1024);
     socket.setSendBufferSize(64 * 1024);
     while (true) {
         byte buf[] = new byte[64 * 1024];
         DatagramPacket packet = new DatagramPacket(buf, buf.length);
         socket.receive(packet);
         System.out.println("got " + packet.getLength() +
                      " bytes from " + packet.getAddress());
}

Similar Messages

  • Using UDP broadcast instead of UDP multicast on a LAN (multicast not working on a major UK ISP router)

    I've built an Android app using Cirrus  that allows users on a LAN to chat in Morse code! - You can find it on the Android Market by searching for 'Morse Intercom'.
    It works fine on my network, lots of other networks, but not on probably the most popular fast broadband fibre network in the UK
    A friend of mine has let me piggyback on her network from this provider, and the problem appears to be that the UDP multicast packets RTMFP transmits just aren't being put on the wireless network. FYI the multicast address I use is IP 225.226.227.1 port 32112 .
    This is probably fixable in the router, but 99.5% of users will never mess around with the router (and why should they), and if possible I would like to fix this in RTMFP.
    Is it possible for me to ask RTMFP to not use UDP multicast, but instead to use UDB broadcast for discovering peers on the LAN ? The problematical router (and all others?) supports UDP broadcasting.
    I tried setting 'groupspec.ipMulticastMemberUpdatesEnabled = false;' but this just stopped the app working on anything! What is the purpose of this option?
    FYI:
    To connect without using Cirrus server assistance I use: nc.connect("rtmfp:");
    The complete function I use for setting up multicasting is:
    private function setupGroup():void
    // Create a new Group Specifier object
    //trace("setUpGroup: groupSpec = new GroupSpecifier('myGroup/groupA')");
    trace("setUpGroup: groupSpec = new GroupSpecifier('" + MY_UNIQUE_GROUP_NAME + "')");
    var groupspec:GroupSpecifier = new GroupSpecifier(MY_UNIQUE_GROUP_NAME);
    // Enable posting
    trace("setUpGroup: groupspec.postingEnabled = true");
    groupspec.postingEnabled = true;
    // Specifies whether information about group membership can be exchanged on IP multicast sockets
    trace("setUpGroup: groupspec.ipMulticastMemberUpdatesEnabled = true");
    groupspec.ipMulticastMemberUpdatesEnabled = true;
    // Causes the associated NetStream or NetGroup to join the specified IP multicast group and listen to the specified UDP port.
    //trace("setUpGroup: groupspec.addIPMulticastAddress('225.225.0.1:30000')");
    trace("setUpGroup: groupspec.addIPMulticastAddress('" + MY_MULTICAST_ADDRESS + "')");
    groupspec.addIPMulticastAddress(MY_MULTICAST_ADDRESS);
    // Constructs a NetGroup on the specified NetConnection object and joins it to the group specified by groupspec.
    trace("setUpGroup: group = new NetGroup(nc,groupspec.groupspecWithAuthorizations())");
    group = new NetGroup(nc,groupspec.groupspecWithAuthorizations());
    // Set the NET_STATUS event listener
    trace("setUpGroup: group.addEventListener(NetStatusEvent.NET_STATUS,netStatus)");
    group.addEventListener(NetStatusEvent.NET_STATUS,netStatus);
    In conclusion - On a LAN with up to 250 or so hosts, I can't see why RTMFP shouldn't be able to use UDP broadcasting as an alternative to UDP Multicasting. Can it, and if so how?
    Graham

    Here's more information...
    When trying to connect with a 3rd party product, the connection request is sent out to my ISP's DNS server with details of the service ID. Of course it won't find anything there.
    So then is tries to use NBNS (Netbios Naming Service) on 192.168.1.255, and still can't connect. Then comes back with a TNS error. i tried TNSPING on this address, and it doesn't find it. I have no clue where it gets this address from.
    WHY WON'T IT JUST CONNECT TO THE HOST MACHINE AS DEFINED IN THE TNSNAMES FILE???
    PLEASE HELP!!!!

  • Unable to receive UDP broadcast packets on PPP connection

    I am struggling for two days now with no success. I have two modems (do not ask, some special stuff), that uses dial up (PPP) connection. I tried this on windows XP and it works like a charm. I am sending unicast and broadcast UPD packets. If I
    repeat that on Windows 7 i can send only unicast data, broadcast packets seems to be lost somewhere. I tried to use Microsoft Network Monitor and I can see that broadcasted packets are being received on my PPP connection. But after that, they are gone. Somewhere
    in the kernel. I truly do not understand why. I disabled firewall, antivirus, base filtering engine, tried to log dropped packed in Windows
    Filtering Platform, tried clean WIN7 machine and all that with no success.
    Here is a sample packet received on interface, but it has newer reach my app:
    No. Time Source Destination Protocol Length Info
    1 13:20:56.093380000 192.168.1.50 192.168.1.255 UDP 49 Source port: x11 Destination port: x11
    Frame 1: 49 bytes on wire (392 bits), 49 bytes captured (392 bits)
    Encapsulation type: Ethernet (1)
    Arrival Time: May 7, 2014 13:20:56.093380000 Central Europe Daylight Time
    [Time shift for this packet: 0.000000000 seconds]
    Epoch Time: 1399461656.093380000 seconds
    [Time delta from previous captured frame: 0.000000000 seconds]
    [Time delta from previous displayed frame: 0.000000000 seconds]
    [Time since reference or first frame: 0.000000000 seconds]
    Frame Number: 1
    Frame Length: 49 bytes (392 bits)
    Capture Length: 49 bytes (392 bits)
    [Frame is marked: False]
    [Frame is ignored: False]
    [Protocols in frame: eth:ip:udp:data:vssmonitoring]
    [Coloring Rule Name: UDP]
    [Coloring Rule String: udp]
    Ethernet II, Src: ae:4e:20:00:01:00 (ae:4e:20:00:01:00), Dst: Xerox_00:00:00 (01:00:01:00:00:00)
    Destination: Xerox_00:00:00 (01:00:01:00:00:00)
    Address: Xerox_00:00:00 (01:00:01:00:00:00)
    .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
    .... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
    Source: ae:4e:20:00:01:00 (ae:4e:20:00:01:00)
    Address: ae:4e:20:00:01:00 (ae:4e:20:00:01:00)
    .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
    .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
    Type: IP (0x0800)
    Internet Protocol Version 4, Src: 192.168.1.50 (192.168.1.50), Dst: 192.168.1.255 (192.168.1.255)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
    0000 00.. = Differentiated Services Codepoint: Default (0x00)
    .... ..00 = Explicit Congestion Notification: Not-ECT (Not ECN-Capable Transport) (0x00)
    Total Length: 34
    Identification: 0x0032 (50)
    Flags: 0x00
    0... .... = Reserved bit: Not set
    .0.. .... = Don't fragment: Not set
    ..0. .... = More fragments: Not set
    Fragment offset: 0
    Time to live: 126
    Protocol: UDP (17)
    Header checksum: 0xb817 [correct]
    [Good: True]
    [Bad: False]
    Source: 192.168.1.50 (192.168.1.50)
    Destination: 192.168.1.255 (192.168.1.255)
    [Source GeoIP: Unknown]
    [Destination GeoIP: Unknown]
    User Datagram Protocol, Src Port: x11 (6001), Dst Port: x11 (6001)
    Source port: x11 (6001)
    Destination port: x11 (6001)
    Length: 14
    Checksum: 0xafd1 [validation disabled]
    [Good Checksum: False]
    [Bad Checksum: False]
    Data (6 bytes)
    0000 34 34 34 34 34 34 444444
    Data: 343434343434
    [Length: 6]
    VSS-Monitoring ethernet trailer, Source Port: 127
    Src Port: 127
    I am running out of my ideas, if anyone could help, with any idea, please do. I am not sure if this feature is dropped in win7 or not.

    Hi,
    From your description, you may gather the network monitor traces to ensure which part lost UDP broadcast packets.
    Thank you.
    Best regards,
    Stevens Song 
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • UDP broadcast over multinetted VLAN

    We're having an issue with UDP broadcast over a VLAN that has three IP's configured on it.  This is on a Cat 6509.
    interface Vlan11
    description ZZZZ
    ip address 10.10.249.1 255.255.255.0 secondary
    ip address 10.10.250.1 255.255.255.0 secondary
    ip address 192.168.101.1 255.255.255.0
    no ip redirects
    ip pim sparse-mode
    The device broadcasting is 192.168.101.34.
    We've added the global config:
    ip forward-protocol udp 4444
    And we've tried interface commands like:
    ip helper-address 192.168.101.34
    and
    ip directed broadcast
    Nothing seems to help, though.  Are there any inherit limitations due to the multinet?  Devices on the 192.168.101.0/24 subnet receive the broadcast fine.  Devices on the other two subnets do not.  Basic routing between all subnets is fine.
    Thanks,
    Joe

    Hi John,
    If you're running 2008R2 DHCP, you can fix the DHCP issue that you're having by configuring a DHCP super scope on the DHCP server.  We ran into that problem too and managed to get DHCP working on all three subnets.  I know it works on 2008R2 but not sure on other versions.
    We're mandated to get off the 192.168.101.0 subnet; so, if we can't get it working this way we may need to do a complete cutover including re-IP-ing all devices involved in this dilemma.  It's more complicated than I'm stating as this is basically a troubleshooting step to see why it broke.  There's an application server involved, an audio streaming server, and some Barix devices.  We're attempting to get all the workstations cutover first when we ran into this issue.
    Thank you,
    Joe

  • WRT54GX2 does not pick up time from the network...

    I have a WRT54GX2 running firmware 1.01.14 and it does not pick up time from the network. I have PacBell (now AT&T) as an ISP and a DSL link. My old Netgear router picks up the time immediately. I am trying to figure out if I have a defective unit or if this is a firmware bug. Without the time, I can not use any of the scheduling functions, nor measure uptime.
    Does anyone have this router with the time working? I have set the appropriate time zone.
    Thanks,
    Martin

    mneiman wrote:
    Thanks for you ideas.
    The backup file appears to be binary. However in searching through it I did see 3 time related text strings, namely: clock.stdtime.gov.tw, time-b.nist.gov and time.nist.gov. I can successfully ping clock.stdtime.gov.tw and time.nist.gov. This reinforces my belief that my ISP (AT&T nee PacBell) is not blocking access.
    however ntp works on TCP port 123. ping works on udp 7 afaik. if your old netgear works i guess this is a router problem.
    have you reset the router yet? afaik press reset button for 10 seconds.
    you will however loose all settings and need to enter them again. it may however fix the issue.Message Edited by linksysinfo on 07-09-2006 03:09 AM
    Regards Simon
    NAS: TS-459 Pro - 3.6.1 Build0302T - 4 x 1TB Samsung HD103SJ : EXT4 - APC ES 700VA UPS
    QPKG: WordPress 3.4, TwonkyMedia 6.0.39 QPKG - Zenphoto1.4.2.1 [7802] - phpMyAdmin v3.3.10
    Network: Netgear DG834G V4.01.40 - DGTeam Rev. 0849 -> Cisco RV220W 1.0.4.13, Cisco SLM2008, Dlink DSM-520, Xbox360

  • Why WRT54G ver 7 blocks all UDP broadcasts?

    My WRT54G seems to be blocking all UDP broadcasts in the intranet side. Is there an option somewhere, which controls this behaviour, because I have not found one.
    It does not matter, if I connect my laptop with a cable or by WLAN, no UDP broadcast packets from my server to the laptop go through.
    If I connect to either one of my regular switches, UDP broadcast works perfectly.
    Note that I'm not using the WAN port at all, so I would expect no filtering on the traffic.

    Interesting! 
    For sake of argument, can you try using the broadcast address of 255.255.255.255 - this is a limited (local network only) broadcast.
    Can you see the MAC (layer 2/ethernet) portion with your tool? 
    The MAC of the destination needs to be all FFs (all ones) for broadcasts. 
    I am wondering if something is happening at a lower level - like in how switching is implemented in the linksys.  I wonder if a linksys switch (only) also does this.
    NOTE - ICMP echo (PINGS) do go through my WRV54G to specific addresses and broacdcast the x.x.x.255 addresses. 

  • UDP Broadcast Traffic from Cisco ASA

    Hi,
    I want to know that, like Cisco IOS Router, Does Cisco ASA pass the UDP Broadcast traffic e.g., TFTP etc...?
    Any thoughts ???
    BR,
    Mubasher Sultan

    Hi Mubasher,
    Unlike the router the ASA does not forward any kind of broadcast packet (with the exemption of the DHCP broadcasts when DHCP Relay is enabled).
    I understand that your DHCP server is providing here the IP address for your TFTP servers. I guess you are using DHCP option 150.
    So if the DHCP server is on one interface and the client is on another you can configure DHCP Relay on your ASA.
    http://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a008075fcfb.shtml
    In regards of the TFTP requests these will be normal unicast packets as Cadet said so just make sure that you have the proper ACLs and NAT rules for that.

  • EEM send UDP broadcast

    I need an "action" statement that will send a UDP broadcast to port 1001 with a message of "restart". I have the rest of the EEM script created fine. I cannot seem to figure out how to do this. I have a BGP route that changes every once in a while and when it does the application seems to stop functioning correctly. A restart of the application fixes the issue. The vendor says that if I can send the UDP broadcast then he can program it to see the broadcast and restart iteself. I have created an EEM script that sees the syslog "%BGP-5-ADJCHANGE:" and currently sends an email. BUt we have to manually restart the app. If this is not possible within EEM could it be done with a TCL script and the EEM call the TCL script?
    I appreciate any words of wisdom. Thank you in advance.

    EEM currently does not support UDP.  Yes, a tclsh called from EEM could do this assuming you have a new enough IOS.  The UDP extension is documented at
    http://www.cisco.com/en/US/docs/ios-xml/ios/ios_tcl/configuration/12-4t/nm-script-tcl.html .

  • Weblogic 10.3.2.0 installation does not pick the right JDK

    The installation does not pick up the right jdk version that is jdk 11.6.0_11 . Although the machine is running the same. Instead it picks up jdk 1.6.0_14. have tested the machine many times. I am Installing Oracle SOA Suite 11g.

    Inside "startWebLogic.sh" file add the JAVA_HOME like following (just below the "setDomainEnv.sh" call):
    JAVA_HOME=C:\bea103\jdk1.6.0_17
    See if this helps.
    Thanks

  • I have an old iphone 3G that I want to use as an ipod touch. It does have a sim card and it has been reset but for some reason it will not pick up my wireless network, or any other wireless network.  What is the problem?

    I have an old iphone 3G that I want to use as an ipod touch.  It does have a sim card in it and it has been reset. For some reason it will not pick up my wireless network in my house, or any other wireless network.  What could be the problem?

    Is this the problem:
    iOS: Wi-Fi or Bluetooth settings grayed out or dim

  • AP - Payment Process not picking up Invoices

    Hi All,
    I am running the payment process from AP(Payments Manager).I have created 5 Invoices on 12-Dec-2013 and have attached the Pay Group. Once i run the payment process with the pay group none of my invoices has been picked up for processing.I have given the date range from 01-Dec-2013 to 13-Dec-2013
    Please help i need close this task ASAP
    Regards

    Hi,
    What are the payment terms on the invoices? If these are not IMMEDIATE, and the payment is not due, the system would not pick them up until they are due.
    What is the payment method on the invoice and in the PPR? Are you running the PPR for electronically paid invoices but the invoices are set to be paid by check?
    Are there any holds on the suppliers you are trying to pay?
    What are the other parameters you gave when running the PPR? It helps to check those against the invoice to make sure they would qualify.
    Information about the pararameters you are using and one of the invoices to be selected would be helpful.
    Cheryl

  • Document type KR is not picking to Clear GL account with T-code F-03

    Hi all,
    My client wants to clear GL account Cash-in-Transit which is open item managed. He has posted two items. One is with KR document type like Intercompnay adjustment account debit (40) and Cash-in-Transit account credit (50). Second item is with SA document type like Cash-in-Transit accont debit (40) and Intercompany adjustment account credit (50). He did not give vendor number and appropriate posting key (31) while postings. With document type KR, he posted with posting keys 40 and 50. Now while clearing the GL account through T-code F-03, system is picking only SA document type. The system is not picking document type KR. He wants to clear the items with each other. I have checked the document type settings. Check boxes Intercompany postings and trading partner are active in both above document types.
    How can the GL account be cleared ? Are any configuration settings missing ? Kindly advice as soon as possible.
    Thanks in advance.
    Regards,
    K.S.K

    Hi,
    First of all..why would system need a Exchange gain/Loss Account..If your local currency is INR and you posted a debit and a credit document both in INR..then there is no question of a foreign exchange gain/loss account..
    BUT, if you have posted the document in any currency other than INR, ie: your local currency...then the system would need a exchnage gain/loss account when you try to clear the debits and credits.. i am giving an example below to explain better..
    You posted a debit of 100 USD @ 40 = Rs. 4000.00
    You posted a Credit of 100 USD @ 42 = Rs. 4200.00
    Now, if you clear this debit and credit then there is no difference in 100 USD, as the debit and credit is netting off.. but if you see INR there is a difference of Rs. 200.00 which system posts to Exchange gain/loss account..which we maintain in OB09.
    Hope it is clear to you now..
    Regards,
    SAPFICO.

  • Vendor account not picked in F110 payment run

    Hi Sap Experts,
    i have assigned two payment methods to vendor master X,Y,which i do payment run for X for currency USD all the documents are picked for payment and when i run another payment run same time for Y  for currency INR its not picking up in payment run even all the open item s are due,
    could help me to solve the issue
    Laxmi

    Hi,
    Delete the current proposal of the payment run. Enter parameters once again. In Free selection tab restrict the currency to INR field. Run the proposal once again. If it still does pick up line items, check the following things
    1. Parameters of the first payment run. Did you restrict the payment run only for the first payment method
    2. Also see the dates entered in parameter tab of both runs
    Regards,
    radha

  • TDS liability line items are not picking in u2013 J1INCHLN

    Hi Experts
    During depositing of TDS through J1INCHLN it is not picking all line items i.e. available in Ledger (FBL3N). We came to know after reconciliation even as all line items are available in table With_item as uncleared.
    We are facing this problem as the data from 01.03.2009u2026. Previously everything was working fine.
    One more thing I will stress here that we have started Purchase Order based invoice verification also from this period.
    Pl help ASAP.
    Regards
    Kuldeep Dubey

    check the line of TDS is having the Business Place, if the business place is not capturng in TDS line items , then the create the substitution for Business Place & Section Code.
    without business place in TDS line items you can't make the TDS payment.
    Regards
    Akmal

  • Document not picked in F110

    Invoice doc: 5000000001
    Due on: 12/30/2008
    Baseline date: 11/10/2008
    Payment terms: 50 days net due
    Vendor master details:
    Vendor: 241344
    Payment method: E
    Payment proposal Details:
    Payment run on 12/29/2008 through F110 t-code
    Parameters:
    Identification:MTR1
    Payment method: E
    Vendor:1 to 99999999
    Result : above invoice doc not picked
    Second payment executed on same day 12/29/2008
    Parameters:
    MTR2
    Payment method: C
    Vendor: 1 to 99999999
    Result: above invoice picked in proposal but not cleared giving error u201CPmnt methods for this run are not specified in master record or in itemu201D.
    Again same executed on 30th but not picked but finally picked on 01/02/2009
    My question is why document is not picked in MTR1 which has correct values.

    Hi
    In F110 , when ever you run Payment Proposal , it picks the invoices which are due for the Payment Run date. It also depends on the Next Run Date , Based on the Discount periods of the Payment terms.
    In both MTR1 & MTR2 , check your Next Run date.
    Regards
    Venkat

Maybe you are looking for