-1

I'm using perl raw sockets to send a large number of arbitrary raw packets (nothing malicious!), but I only get about 14500 going out before my send() call fails with "No buffer space available".

I'm guessing that something in the kernel is keeping track of what I'm sending? How can I prevent that. I just want to send each packet, there is no necessity to wait for replies or remember anything about what got sent. (Update: I notice loads of "CLOSE_WAIT" entries in my "netstat" command - how do I tell the kernel not to do that?)

What is the "buffer space" it's referring to, and is there a way to check what space is available, so I can avoid sending more when there's no room? Alternatively - is there a way to "block" on "send()", so I never experience the error?

Alternatively - is there some other way to send out an ethernet packet (eg: a SYN), where the kernel knows not to enter anything into any tables?

cnd
  • 1,689
  • 16
  • 14
  • Are you using TCP? If so, that is the reason for the CLOSE_WAIT entries. Try UDP instead. – EEAA Mar 13 '14 at 03:14
  • If, after getting the error from send(), you sleep() for a second, can you then send() again without error, or is it a permanent error (once you get the error, you must end the process or perform some other steps to recover)? – Slartibartfast Mar 13 '14 at 04:31

1 Answers1

1

If the CLOSE_WAIT connections are yours:

  1. You are using TCP, not raw sockets.
  2. You aren't closing your sockets.
user207421
  • 305,947
  • 44
  • 307
  • 483