Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ac000/udp-fwder

Program to post information contained in UDP packets to a web server
https://github.com/ac000/udp-fwder

Last synced: 7 days ago
JSON representation

Program to post information contained in UDP packets to a web server

Awesome Lists containing this project

README

        

Getting Started
===============

The only requirement to compile this is libcurl.

# yum install make gcc libcurl libcurl-dev

should ensure you have what you need.

Before you compile the server, you should edit the config.h file for your
situation. A simple make should then build the program which can then be
started by

$ ./udp-server

NOTE: It does not need to (and really shouldn't) run as root.

Pressing Ctrl-c will terminate the server and display some statistics.

How It Works
============

The server is built as a multi-threaded program. The main thread is
responsible for receiving the UDP packets and the other threads then pass
that data onto the destination server.

Due to the packet rates required to be handled, in the 5,000 to 10,000
pkts/sec range, it is required to buffer the UDP packet data in the server.

This data is stored in a circular buffer that can contain QUEUE_SZ entries.
The main thread upon receiving a UDP packet places its data into the buffer.
The forwarder threads then take the data out of this buffer and send them
to the remote web server via HTTP GET using libcurl.

If the web server can't accept the requests as quick as the packets are
comming into the server then it is likely that at some point the buffer
will overflow. If this happens the server will display a "Queue overflow..."
message. This means some packets will have been overwritten in the buffer.
This bahaviour could be easily changed to say, terminate the server on such
instances.

License
=======

This is licensed under the MIT license. See MIT-LICENSE.txt