Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6752867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:05:41+00:00 2026-05-26T13:05:41+00:00

How to respond to a multicast udp message sent from a different ip range?

  • 0

How to respond to a multicast udp message sent from a different ip range?
I have a scenario in which I’ve implemented a simple SLP server (http://www.openslp.org/doc/rfc/rfc2608.txt) on a small device and a simple SLP client on a PC.

The device has an ip. Eg. 10.0.0.50
The PC however has several ips. Eg. 10.0.0.70, 192.168.1.70, 172.19.1.70
The PC also have several network adapters, that each have several ips. (Never mind that.)

From the PC I send out an udp message to the slp multicast group:

System.Net.Sockets.UdpClient client = new System.Net.Sockets.UdpClient(new System.Net.IPEndPoint(System.Net.IPAddress.Any, 0));
client.Send(m_tx_buffer, encoded, SLPMULTICASTGROUP, SLPPORT);

The .net UdpClient will select a random ip to attach to the udp message.
The device will recieve the udp message and send back a unicast message to the given sender ip. Like so:

int mysock;
struct sockaddr_in myaddr, cliaddr;
char msgbuf[MAXLEN];
socklen_t clilen;
int msglen;
mysock = socket(PF_INET,SOCK_DGRAM,0);
myaddr.sin_family = AF_INET;
myaddr.sin_port = htons( S_PORT );
myaddr.sin_addr = htonl( INADDR_ANY );
bind(mysock, &myaddr, sizeof(myaddr));
while (1) {
   len=sizeof(cliaddr);
   msglen=recvfrom(mysock,msgbuf,MAXLEN,0,cliaddr,&clilen);
   sendto(mysock,msgbuf,msglen,0,cliaddr,clilen);
}

Problem is if the .net chooses eg. ip 192.168.1.70. The device will respond to this. And it doesn’t seem to get through to the PC. (The PC and the device share the 10.0.0.x range.)

Is it supposed to get through? (I’ve verified with Wireshark that the message doesn’t arrive on the PC. And I’ve verified with my jtag that the device sends out a message.)

To solve this I could make the PC enumerate all ips and send out several udp messages. But this has somewhat bad performance and it risks flooding the poor devices. (The device will recieve all the messages and respond accordingly. It’s the PC that doesn’t recieve the responses.)

Is it my device (it’s a small RTOS btw.) that has a flawed transmisson?

Or is there some way to solve this problem, without flooding my small devices?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:05:41+00:00Added an answer on May 26, 2026 at 1:05 pm

    If you want your device to be able to send to IP addresses that aren’t on the directly attached subnet, you’ll have to give it routes for those IP addresses.

    You might be able to simply give it a default route through the PC (ie. a default route with a gateway of 10.0.0.70).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added respond.js to activate media queries in ie7+8, the problem that Im
Overview: I have set up a server and a client, where both attempt discovery
I have a Model Book with a virtual attribute for create a Editor from
I'm looking to respond to XML. In my show action, I have something like
I have a C# .Net 3.5 application that sends a multicast Hello packet to
I have the following test: it should respond with a json object do xhr
I have a project with an Article scaffold - which includes a paperclip file
I have successfully been able to implement the addition of new artist entries which
warning: 'NSDate' may not respond to '+currDate' Above is a warning message when I
I would like to respond to different formats in my Rails app: respond_to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.