Statistics
| Branch: | Revision:

ml / README @ 8b17961c

History | View | Annotate | Download (2.19 KB)

1
This is an short explaination for the messaging layer library.   
2

    
3
The library requires the libevent library in the version 
4
2.0.1 alpha and the C math library. The library is implemented in C and works in unix/linux. It is tested with Ubuntu 8.04.
5

    
6
The library can be compile with ./make.
7

    
8
This library is a network layer abstraction for p2p systems, that has the primitives: 
9
	- connect to a peer 
10
	- send arbitrary size data to a peer
11

    
12
Furthermore, it provides the functionalites: 
13
	- pmtu discovery
14
	- NAT traversal
15
	- data fragmentation and reassembly
16

    
17
The library has six source code files: messagingLayer.h messagingLayer.c transmissionHandler.h transmissionHandlder.c stun.h stun.c udpSocket.h udpSocket.c 
18

    
19
The files stun.h stun.c udpSocket.h udpSocket.c are placed in the subfolder "util". 
20

    
21
The messagingLayer.h and messagingLayer.c files contain the functions of the API. These files are only wrapper files for function in the transmissionHandler.h and transmissionHandler.c files. 
22

    
23
The files transmissionHandler.h and transmissionHandler.c have the main functionality of the messaging layer. For simplicity several functionalites were excluded into utility files stun.h, stun.c, udpSocket.h ,and udpSocket.c .
24

    
25
Stun.h and stun.c contain the NAT traversal functionality according to STUN. They are used by the transmissionHandler to implement a STUN client.
26

    
27
The udpSocket.h and udpSocket.c files contain a udp socket abstraction. In the current implementation the file works only with a unix socket.   
28

    
29
We implemented a simple echo server to show how the messaging layer library can be used. The echo server can be found in the main directory and it is named echoServer.c . 
30

    
31
The echo server demonstartion requires that you start a STUN server first. An open source STUN server is in the folder "stun_server". It can be started with the script start_stun_server.sh. In the following you have to start three instances of the echo server in different shells, each with a different argument. The arguments are 1, 2, and 3. 
32

    
33
The commands for the demo in short: 
34
    In the folder stun_server/stund/ start
35
    ./start_stun_server.sh
36
    Back in the original folder start
37
    ./echoServer 1
38
    ./echoServer 2
39
    ./echoServer 3