Home > UDP-

UDP-

UDP- is a project mainly written in ..., it's free.

UDP transport protocol (in order)

UDP+ Header Format

0                   1                   2                   3   
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |S|A|S|F|O| | Header | | |E|C|Y|I|P| | Length | Sequence # | |Q|Q|N|N|T| | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Optional Field For SACK | | Acknowledgment # | Controlled by OPT BIT and | | | Header Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

UDP+ data flows both ways. The acknowledgement and sequence numbers allow for inorder transmission of both. This protocol is very similar to TCP, except that it is packet-oriented instead of stream-oriented

The OPT bit is used for SACK. If the bit is set, the Optional field contains a bitlist. This bitlist allows for packet retransmission if data loss is intermittent, by having only missing packets retransmitted. To prevent too much data from being queued at the server or denial of service attacks, the server will automatically disconnect connections after 1 minute of no communication or the application not removing data from the buffer for 1 minute.

Both the server and client applications use a maximum internal buffer size that single connections can keep to cache outgoing packets until they are ACKED or retried from the application. The server also specifies the maximum number of client connections that are supported.

HOW TO COMPILE: Must link with boost_thread library

cd ~/Documents/xcode/net/build/Debug

                                      +-+-+-+-+-+-+-+-+           +-+-+-+-+-+-+-+-+-+
                                      |     UDPPlus   | -> spawns | listener thread |
                                      +-+-+-+-+-+-+-+-+           +-+-+-+-+-+-+-+-+-+ 

                                              |
                                              | has many UDPPlusConnections
                                              |
       ------------------------------------------------------------------------
       |                                                                      |
+-+-+-+-+-+-+-+-+-+-+           +-+-+-+-+-+-+-+-                    +-+-+-+-+-+-+-+-+-+-+           +-+-+-+-+-+-+-+-
| UDPPlusConnection | -> spawns | timer thread |                    | UDPPlusConnection | -> spawns | timer thread |
+-+-+-+-+-+-+-+-+-+-+           +-+-+-+-+-+-+-+-                    +-+-+-+-+-+-+-+-+-+-+           +-+-+-+-+-+-+-+-

From an applications perspective, you would create a UDPPlus object first. Then use that object to create as many connections as you would like. The UDPPlus object has a single thread that listens to all incoming data and determines what to do with that data. Each UDPPlusConnection objects have a timer thread that can detect a timeout.

Previous:OTpad