?
Solved

Determine if send/receive queue is full (Data-link layer).

Posted on 2005-04-14
3
Medium Priority
?
261 Views
Last Modified: 2010-04-01
Hi experts,

I'm writing a Win32 program to send ARP requests and receive replys in two threads.
The question is that i need to send so many ARPs (to all subnet IPs) so the send/receive queues may be full.
The consequence is that some of the ARPs are push out of the queue.
Currently my temp solution is to sleep 5 ms each time an ARP is sent so the send queue won't get full.

My question is to find a way to detect the status (if its full) of both send/receive queues?


Many thanks,

Polo Wang
0
Comment
Question by:teltel
3 Comments
 
LVL 22

Accepted Solution

by:
grg99 earned 1500 total points
ID: 13789899
You'd be better off sending just one or a few  broadcast ARP to all nodes.

The basic problems are:

(1)  You can't rely on ARP packets to go out.  ARP like UDP is not guaranteed to be reliable, so the system is free to drop packets anywhere along the line.  There generally is NO way for you to find out what's been dropped or where or why.

(2)  You can't rely on ARP replies to make it back to you.  They can get dropped due to xmission errors or network colissions.    Even if you slow down your sending rate, the packets going in or out may collide with other net traffic which is beyond your control.


You could also pace your sending by keeping a maximum limit on the number of outstanding ARp packets out there.  Count the number you send out, count the number you get back, and try to keep the difference to a small number.  The count will climb up, as some nodes are not there, and some replies will get lost.  If you hit your limit, wait a second, that should ensure all outstanding packets are accounted for or lost, then you can restart sending.



0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 13790209
I would recommend to change to TCP/IP. Though it is slower it guarantees all packets to be sent/received in the correct order. If you couldn't change, at the receiver site you would need to request missing or incomplete packets using a second connection. However, that exactly is what TCP/IP does automatically and I could think that it is faster when doing it yourself.

Regards, Alex
0
 
LVL 1

Author Comment

by:teltel
ID: 13803289
I need to send many ARPs so TCP/IP will take lots of time; I need to setup a tunnel before i can send a ARP through TCP.
It is still best for me to do it on layer2.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question