Re: Multicast
"Steve Trigero seecwriter-/[email protected] [rabbit-semi]" <[email protected]> Fri, 22 Jul 2016 16:19:23 +0000 (UTC)
| Newsgroups | gmane.comp.hardware.rabbit-semiconductor |
|---|---|
| Message-ID | <[email protected]> |
Ah, you're right about the debug_on variable. I forgot about that. In any case, it's working for now.
Yes, I was referring to MAX_UDP_SOCKET_BUFFERS. I know I need them. I was asking about the ratio of sockets to buffers. Could I get away with a single UDP socket and say 5 buffers withoutdropping datagrams?
This comes up because I am experimenting with Multicast, which I've not used before. Normally,I open 3 sockets with REMIP and PORT set to -1, so they will accept datagrams from any host,whether Broadcast or directed. And I have MAX_UDP_SOCKET_BUFFERS set to 4.
To add Multicast, I needed a socket that was opened with REMIP set to a Multicast IP. It's when Iadded this new socket is when the issue of losing the first datagram appeared, and has now disappeared. When I saw the dropped/lost first packet, I thought it might be related to the comment for udp_extopen() in the manual that says:
"If remip is non-zero, then the process of resolving the correct destination
hardware address is started. Datagrams cannot be sent until sock_resolved()
returns TRUE. If you attempt to send datagrams before this, then the
datagrams may not get sent."
But when I ran the debugger, it went away.
So now I have 4 UDP sockets, with one being for Multicast, and I increased the buffers to 6. Should Ihave more Multicast sockets or less Broadcast sockets? Could I get away with one socket of each?
Steve
From: "Dave Moore dmoore-f4pv2F5LI2c/CDIEhCN/twC/[email protected] [rabbit-semi]" <[email protected]>
To: [email protected]
Sent: Friday, July 22, 2016 7:42 AM
Subject: Re: [rabbit-semi] Multicast
Along with UDP_VERBOSE, set the global debug_on to something like 7 on startup. Should produce more debug output.
And when you mention "UDP sockets" and "number of UDP buffers", are you actually talking about some of the macros (like MAX_UDP_SOCKET_BUFFERS?) Cuz you do need buffers to hold your packets (unless you alloc and supply your own to the udp handler code.) I don't believe there is a limitation to the number of udp sockets? Been a while though since I was in there. -- Dave
On 7/21/2016 2:55 PM, Steve Trigero seecwriter-/[email protected] [rabbit-semi] wrote:
UDP_VERBOSE doesn't do anything. There is no output when it's defined. I'm using your updated network library, so maybe something happened there.
In any case, after I ran my code in the debugger, it started working. So I recompiled without debug code enabled and reloaded the program, and now it works every time. Scary.
Slight change of subject.
First, what's the relationship between the number of UDP sockets and number of UDP buffers? Since UDP is connectionless, a socket for each potential device that may send a datagram is unnecessary. But does that mean I could have one socket with a bunch of buffers? A further explanation is, in a system we typically have 5 sub-systems, with each sub-system sending a broadcast UDP datagram of its status twice a second. The datagrams are around 150 bytes each. Each sub-system reads the datagrams and collects whatever information it needs from the datagrams. So if there is only one UDP socket and the Rabbit is processing one datagram when another one arrives, or even two datagrams arrive, do the new datagrams get put into unused buffers or are they lost because there is not an unused socket available?
Steve
From: "Tom Collins tom-lnEA/wrDJtNWk0Htik3J/[email protected] [rabbit-semi]" mailto:[email protected]
To: [email protected]
Sent: Thursday, July 21, 2016 11:28 AM
Subject: Re: [rabbit-semi] Multicast
Do you see the packet come in if you define UDP_VERBOSE in your program?
I've seen instances where the first response to a UDP datagram doesn't go out due to needing to ARP the IP address, but there are some ways around that (telling the stack to use the MAC from the received frame).
I'm on vacation through the end of the month, so don't have access to code I can share, but I'm curious as to whether the datagram moves through the TCP/IP stack at all.
-Tom
On Jul 21, 2016, at 12:23 PM, seecwriter-/[email protected] [rabbit-semi] wrote:
I added a Multicast socket to my RCM3900 application, using IP 239.255.255.255. I have a total of 4 UDP sockets open, 3 are opened with an REMIP and Port of -1, and one is opened with the Multicast IP and port 2100. And Max UDP Buffers is set to 5.
After boot-up, the first UDP datagram to the module is not responded to. It doesn't matter if the datagram was a broadcast or a multicast. The first one is not responded to. After the first one, then it starts responding to both broadcasts and multicasts.
Is there something else I need to do to get that first datagram to work?
I'm using DC 9.62. .
#yiv3715481391 #yiv3715481391 -- #yiv3715481391ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv3715481391 #yiv3715481391ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv3715481391 #yiv3715481391ygrp-mkp #yiv3715481391hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv3715481391 #yiv3715481391ygrp-mkp #yiv3715481391ads {margin-bottom:10px;}#yiv3715481391 #yiv3715481391ygrp-mkp .yiv3715481391ad {padding:0 0;}#yiv3715481391 #yiv3715481391ygrp-mkp .yiv3715481391ad p {margin:0;}#yiv3715481391 #yiv3715481391ygrp-mkp .yiv3715481391ad a {color:#0000ff;text-decoration:none;}#yiv3715481391 #yiv3715481391ygrp-sponsor #yiv3715481391ygrp-lc {font-family:Arial;}#yiv3715481391 #yiv3715481391ygrp-sponsor #yiv3715481391ygrp-lc #yiv3715481391hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv3715481391 #yiv3715481391ygrp-sponsor #yiv3715481391ygrp-lc .yiv3715481391ad {margin-bottom:10px;padding:0 0;}#yiv3715481391 #yiv3715481391actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv3715481391 #yiv3715481391activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv3715481391 #yiv3715481391activity span {font-weight:700;}#yiv3715481391 #yiv3715481391activity span:first-child {text-transform:uppercase;}#yiv3715481391 #yiv3715481391activity span a {color:#5085b6;text-decoration:none;}#yiv3715481391 #yiv3715481391activity span span {color:#ff7900;}#yiv3715481391 #yiv3715481391activity span .yiv3715481391underline {text-decoration:underline;}#yiv3715481391 .yiv3715481391attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv3715481391 .yiv3715481391attach div a {text-decoration:none;}#yiv3715481391 .yiv3715481391attach img {border:none;padding-right:5px;}#yiv3715481391 .yiv3715481391attach label {display:block;margin-bottom:5px;}#yiv3715481391 .yiv3715481391attach label a {text-decoration:none;}#yiv3715481391 blockquote {margin:0 0 0 4px;}#yiv3715481391 .yiv3715481391bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv3715481391 .yiv3715481391bold a {text-decoration:none;}#yiv3715481391 dd.yiv3715481391last p a {font-family:Verdana;font-weight:700;}#yiv3715481391 dd.yiv3715481391last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv3715481391 dd.yiv3715481391last p span.yiv3715481391yshortcuts {margin-right:0;}#yiv3715481391 div.yiv3715481391attach-table div div a {text-decoration:none;}#yiv3715481391 div.yiv3715481391attach-table {width:400px;}#yiv3715481391 div.yiv3715481391file-title a, #yiv3715481391 div.yiv3715481391file-title a:active, #yiv3715481391 div.yiv3715481391file-title a:hover, #yiv3715481391 div.yiv3715481391file-title a:visited {text-decoration:none;}#yiv3715481391 div.yiv3715481391photo-title a, #yiv3715481391 div.yiv3715481391photo-title a:active, #yiv3715481391 div.yiv3715481391photo-title a:hover, #yiv3715481391 div.yiv3715481391photo-title a:visited {text-decoration:none;}#yiv3715481391 div#yiv3715481391ygrp-mlmsg #yiv3715481391ygrp-msg p a span.yiv3715481391yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv3715481391 .yiv3715481391green {color:#628c2a;}#yiv3715481391 .yiv3715481391MsoNormal {margin:0 0 0 0;}#yiv3715481391 o {font-size:0;}#yiv3715481391 #yiv3715481391photos div {float:left;width:72px;}#yiv3715481391 #yiv3715481391photos div div {border:1px solid #666666;min-height:62px;overflow:hidden;width:62px;}#yiv3715481391 #yiv3715481391photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv3715481391 #yiv3715481391reco-category {font-size:77%;}#yiv3715481391 #yiv3715481391reco-desc {font-size:77%;}#yiv3715481391 .yiv3715481391replbq {margin:4px;}#yiv3715481391 #yiv3715481391ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv3715481391 #yiv3715481391ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv3715481391 #yiv3715481391ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv3715481391 #yiv3715481391ygrp-mlmsg select, #yiv3715481391 input, #yiv3715481391 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv3715481391 #yiv3715481391ygrp-mlmsg pre, #yiv3715481391 code {font:115% monospace;}#yiv3715481391 #yiv3715481391ygrp-mlmsg * {line-height:1.22em;}#yiv3715481391 #yiv3715481391ygrp-mlmsg #yiv3715481391logo {padding-bottom:10px;}#yiv3715481391 #yiv3715481391ygrp-msg p a {font-family:Verdana;}#yiv3715481391 #yiv3715481391ygrp-msg p#yiv3715481391attach-count span {color:#1E66AE;font-weight:700;}#yiv3715481391 #yiv3715481391ygrp-reco #yiv3715481391reco-head {color:#ff7900;font-weight:700;}#yiv3715481391 #yiv3715481391ygrp-reco {margin-bottom:20px;padding:0px;}#yiv3715481391 #yiv3715481391ygrp-sponsor #yiv3715481391ov li a {font-size:130%;text-decoration:none;}#yiv3715481391 #yiv3715481391ygrp-sponsor #yiv3715481391ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv3715481391 #yiv3715481391ygrp-sponsor #yiv3715481391ov ul {margin:0;padding:0 0 0 8px;}#yiv3715481391 #yiv3715481391ygrp-text {font-family:Georgia;}#yiv3715481391 #yiv3715481391ygrp-text p {margin:0 0 1em 0;}#yiv3715481391 #yiv3715481391ygrp-text tt {font-size:120%;}#yiv3715481391 #yiv3715481391ygrp-vital ul li:last-child {border-right:none !important;}#yiv3715481391