0

In Linux, does UDP use the same buffer for incoming and outgoing packets?

If I want to overflow this buffer, it shouldn't matter if I code in C or in Python, right?

Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185

1 Answers1

1

the linux kernel does not define a single or set of buffers for packets per say, but dynamically creates and destroys many buffers as data is passed up and down to/from higher layers (2 and above).

see this very detailed article on linux network, and in particular look at page 4 on how a buffer is connected to a nic for transmit, and then destroyed as soon as transmission is complete: http://www.linuxjournal.com/article/1312?page=0,0

as for overflowing the buffer, obviously you would need a langague capable of manual memory operations, but linux buffers are a memory location with a control structure associated, so you may not be able to overflow it without the control system interfering.

Frank Thomas
  • 2,434
  • 1
  • 17
  • 28
  • Thank you. My goal is to (locally) send UDP messages to a server at such a rate that the server will drop them after some point. Do you think this is possible in C and in Python? (I'm not asking for the code, of course, just to have a confirmation) – Ricky Robinson Nov 21 '12 at 22:21
  • yes it id definitely possible, because UDP does not implement flow control itself. the network hardware between you and the target however may interfere however. – Frank Thomas Nov 23 '12 at 05:42
  • Oh, for now it's all on the loopback interface, so it works. Thanks! – Ricky Robinson Nov 26 '12 at 10:40