Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sun Nov 19, 2017 3:17 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Thu Apr 16, 2009 5:55 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Hello,

I have a localized network with three items. A switch, a box and a G55 terminal. The box produces two streams of data. Once a second it broadcasts a status message which the G55 receives (on port 52133), parses and displays. The other stream of data the box produces is a high rate multicast stream of data (on port 54321).

When the multicast stream is turned off the G55 receives the broadcast data and works fine.

When the box starts to produce the high rate multicast data the G55 slows to a crawl and is barely responsive. I have one EthernetServer object setup to listen to the broadcast port 52133. My settings are below:


init parent := default
init localport := 52133

func datareceived(channel as comm, data[] as byte, ipaddr[] as byte, foreignport as integer)
--- do stuff ---
endfunc


When I run the simulator this phenomena does not happen, it only happens with the hardware itself.
Any ideas why the multicast stream would slow the G55?

Thanks,
Joe


Top
 Profile  
 
PostPosted: Thu Apr 16, 2009 7:05 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Try this in a new workspace:

Code:
'Global code
func Startup ()
    handles MSG_INIT

    'For the local port parameter use the port that your "box" is transmitting to
    'For the foreign port parameter use the port your "box" is listening on
    '    (if you will not be transmitting, this port does not matter)
    'For the addr, use the multicast group address.
    dim addr[] as byte
    init addr := [234, 0, 0, 1]

    NetOpen(default, NET_UDP, 50000, 50000, addr)

endfunc


func CommAccept (socket as comm)
    handles MSG_COMM_ACCEPT

    RegisterMsgHandler(default, MSG_COMM_RECEIVE_MULTICAST, socket)
    return
endfunc


func CommReceiveMulticast (data[] as byte, lport as unibyte, fport as unibyte, ip[] as byte) returns boolean
    handles MSG_COMM_RECEIVE_MULTICAST
    _print ("Got data")
    return true
endfunc


See if the performance is any better. There could be some issues with trying to receive multicasts as a server instead of a proper multicast listener. Not the least of which is that the G55 won't attempt to send IGMP membership messages to any routers that may eventually be inline.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Thu Apr 16, 2009 7:52 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
Can you tell me the rate of your multi-cast packets? You may just be sending data at a speed that is keeping the G55 too busy parsing data and not able to re-draw the display. Your PC is going to have a lot faster processor etc., which is why you wouldn't see the slow down in simulation view. We should also look to see if there's ways to optimize your parsing code.

You may also find some tips in these FAQs helpful:
viewtopic.php?f=4&t=422
viewtopic.php?f=4&t=164

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Thu Apr 16, 2009 7:55 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Jeremy,

Thanks for the reply. Shouldn't that be NetServerOpen rather than NetOpen?

I want the G55 to only listen to the broadcast messages. I do not want to produce multicast or broadcast messages.

Thanks,
Joe


Top
 Profile  
 
PostPosted: Thu Apr 16, 2009 8:15 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
To listen to broadcast messages, use NetServerOpen

To listen to multicast messages, use NetOpen with a multicast address. In this case, NetOpen opens the multicast group and will only receive multicasts to that group.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Thu Apr 16, 2009 8:25 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Hello,

I think there is some confusion so let me restate the problem.

The source box produces two streams of data:
1. A high rate multicast stream of data on port 54321
2. A slow rate status broadcast message on port 52133. This stream fires a small chunk of data once a second.

The G55 has to listen to stream 2. That is the data which is broadcast from the box once a second.

When the box is only sending the status broadcast the G55 works great.

When the box sends the high rate data the G55 crawls to a stop. The G55 is not setup to listen to this multicast data and should ignore it. It is only suppose to listen to the slow status broadcast. However, it is slowing to a crawl.

I hope this makes it clearer. Jeremy I tried the code you sent and changed it to NetServerOpen. But it generates an Ethernet Error 2.

Any ideas?

Thanks,
Joe


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 4:55 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Jeremy,

Any word on that ethernet error?

Is it possible your IP stack is not able to weed out the multicast packets fast enough? Could this be a firmware or hardware issue?

Joe


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 7:09 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
We are trying to reproduce your setup here so we can see if our network stack is performing as expected. The multicast case is quite a bit more complex than either normal broadcasts or unicasts. I also will need to get with the firmware team to see exactly what the expected capabilities of the MAC filter on the G55 is.

Was the error "connection refused?" (We really deal more with error strings than error numbers around here).

That indicates that you attempted a connection with a device which refused it. Although that is pretty much limited to TCP connections. UDP shouldn't issue that error to my knowledge.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 7:35 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
The error number is the only thing that came back and it came back from one of your objects. Is there a way I can get you more information?

I have a feeling it's more of an issue with your TCP/IP stack than an application level issue. I look forward to hearing what your firmware team says.

Thanks,
Joe


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 8:13 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
We've been trying to reproduce the issue here with no luck so far. I have an application that runs on the PC which will send out Multi-cast udp packets at a high rate, and a broad cast packet at a slow rate. On the Qlarity side I have an Ethernet server listening for the broadcast packets, and an animation to see if the unit slows down. The G55 will receive and count the broadcast messages, but flooding the network with the multi-cast packets doesn't effect the unit.

I've attached my test applications.


Attachments:
IPMulticastFloodSrcCode.zip [74.25 KiB]
Downloaded 157 times
IPMulticastFlood.zip [4.84 KiB]
Downloaded 158 times
img and udp server.qly [6.57 KiB]
Downloaded 153 times

_________________
Ron L.

http://www.beijerelectronicsinc.com/
Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 10:14 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Thanks,

I'll try this out.

Joe


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 10:41 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Ron,

I tried your flooding application and I get the following exception:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable host
at System.Net.Sockets.Socket.SendTo(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint remoteEP)
at System.Net.Sockets.Socket.SendTo(Byte[] buffer, EndPoint remoteEP)
at IPMulticastFlood.Form1.udpPktTmr_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)






If you fix it and send it back can you shut off the broadcast and allow delays down to 0 millis? This way I can test out our app, which interprets the broadcast address with your app blasting the multicast. Would it help you to have a wireshark capture of what our multicast is sending?

Hopefully we can get you to replicate the issue on your side.


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 10:48 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
Yeah, my application is configured to use the IP address of my Ethernet card. You can get Visual C# Express 2008 (free) and use my source code, then you can change the code such as the IP addresses.

Yes, it would be good if you can get us a Wireshark sniff, thanks.

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 10:54 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Ron,

By the way, I didn't look at your clarity code but does it create an EthernetServer class to accept connections from the broadcast socket? If not, may I suggest you add that to your test? Perhaps once you create the server you will get different results.

Joe


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 1:02 pm 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
Yes it does.

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group