Add full support for UDP gateways to iRule

I would like to add UDP gateways to iRule. Exactly the same idea as a TCP gateway (without the username/password option of course); IP address and port number to send packets to and the ability to listen for responses on the same port.

Reason I'm asking is that next to GC I also use the IRTrans system. It's comparable to the Global Caché modules except that the IRTrans devices have more built-in intelligence and memory, allowing them to perform functions on their own (like IR translation and relay, timed commands etc). They communicate commands and (serial) feedback in ASCII through UDP. Supporting that interface would be the easiest way to support them (without any other work)and would greatly enhance the value of iRule for me.

I know I can send a UDP broadcast, but will iRule then listen on that port as well? Targeting specific modules with their IP would be easier.
4 people like
this idea
+1
Reply
  • iRule supports UDP, but you are correct it is limited to broadcast.

    iRule will listen on the same broadcast address. Have you tried this yet?

    I can help brainstorm if you are running into problems. There can be some problems in complicated network setups.

    UDP needs to be setup as NETWORK GATEWAY with IP address of xxx.xxx.xxx.255 where xxx.xxx.xxx is the IP mask of your network.

    What Handset are you using? Android or iOS?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Thanks for the great reply. I am on iOS (iPhone 4, 4S and iPad 3) and will be doing more testing this weekend so as not to waste your time. Commanding the devices is not that hard, as they even support HTTP as a command protocol. It's the RS232 feedbacks that I'm after, they're only sent over UDP. Broadcast *should* work...

    Just as an aside, I like the tiny IRTrans boxes - I've got a tv cabinet here that literally has one big red pushbutton on it, if you press it the tv lifts up out of the cabinet, amps and matrix switches are switched on, the dvr gets fired up and hey presto, you can watch tv. All this with a combination of RS232 and IR and without any pc or other controller device running on my network, power consumption less than 1 watt! (And no, I don't work for the company.)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • As it turns out, the IRTrans devices do receive UDP broadcasts properly and send RS232 feedback data over UDP as well.

    Problem is that a broadcast leads to all devices sending the RS232 command, generating error replies from the serial devices I didn't intend to address (I have three IRTrans modules with attached serial devices). So for iRule to see the feedback properly, I have to suppress the errors somehow. Working on that now.

    This wouldn't happen with a command directed at the proper module of course. Would it be very hard to implement UDP gateways? For the UI part it'd be easy, just a TCP/UDP selection switch in the gateway configuration...
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • This reply was removed on 2012-10-19.
    see the change log
  • I realize this is an old thread, but something isn't clear to me.

    When you say:
    UDP needs to be setup as NETWORK GATEWAY with IP address of xxx.xxx.xxx.255 where xxx.xxx.xxx is the IP mask of your network.

    typically the xxx.xxx.xxx would be the network address, not the mask.

    Can you clarify that for a 192.168.1/24 network, you mean the NETWORK GATEWAY on the iRule handset should be 192.168.1.255?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly