Network layer » History » Version 1

Luca Baldesi, 08/22/2017 04:05 PM

1 1 Luca Baldesi
h1. Network layer
2 1 Luca Baldesi
3 1 Luca Baldesi
The network layer is responsible of managing the exchange of data between the peers, yet its role is of central interest in the complex real networks.
4 1 Luca Baldesi
It exposes to the P2P application a very simple interface:
5 1 Luca Baldesi
6 1 Luca Baldesi
 * send a data buffer b from peer p1 to peer p2
7 1 Luca Baldesi
 * receive a data buffer b from a remote peer p2 with the local peer p1
8 1 Luca Baldesi
9 1 Luca Baldesi
Currently the network layer, called net_helper_x, implements the following advanced features:
10 1 Luca Baldesi
11 1 Luca Baldesi
 * packet fragmentation: needed in order to deal with MTU
12 1 Luca Baldesi
 * very basic loss-recovery: fragments can be requested in case of loss
13 1 Luca Baldesi
 * data shaping: the data is forced to be sent regularly, avoiding traffic peaks
14 1 Luca Baldesi
15 1 Luca Baldesi
The modules implementing these features are called network_manager and shaper.
16 1 Luca Baldesi
17 1 Luca Baldesi
h2. Nomenclature
18 1 Luca Baldesi
We refer with
19 1 Luca Baldesi
20 1 Luca Baldesi
 * "packet" the data buffer exchanged,
21 1 Luca Baldesi
 * "fragment" the portion of packet
22 1 Luca Baldesi
 * "message" to a fragment or a fragment request 
23 1 Luca Baldesi
 
24 1 Luca Baldesi
net_helper_x sends and receives packet from the application layer and it sends and receives messages from the network.
25 1 Luca Baldesi
26 1 Luca Baldesi
h2. Functionalities
27 1 Luca Baldesi
The features listed above can be split in the following conceptual functionalities:
28 1 Luca Baldesi
29 1 Luca Baldesi
 * Sender side:
30 1 Luca Baldesi
 * * Fragment outgoing packets
31 1 Luca Baldesi
 * * Periodically send fragments
32 1 Luca Baldesi
 * * Send fragments upon requests
33 1 Luca Baldesi
 * * Flush old packet (defined by a threshold)
34 1 Luca Baldesi
 * Receiver side:
35 1 Luca Baldesi
 * * Enqueue incoming messages (either fragments or fragment requests)
36 1 Luca Baldesi
 * * Pop completed messages
37 1 Luca Baldesi
 * * Request fragments
38 1 Luca Baldesi
 * * Flush old packet (defined by a threshold)
39 1 Luca Baldesi
40 1 Luca Baldesi
As additional requirements we want:
41 1 Luca Baldesi
 * Fast look-up of data
42 1 Luca Baldesi
 * * getting oldest packet
43 1 Luca Baldesi
 * * getting specific packet (for fragment enqueuing)
44 1 Luca Baldesi
 * * getting next message to be sent
45 1 Luca Baldesi
 * Limit the number of data duplication
46 1 Luca Baldesi
47 1 Luca Baldesi
48 1 Luca Baldesi
h2. The Network Manager
49 1 Luca Baldesi
The network manager is responsible of fragmenting/re-assembling of packets and it keeps the queue of outgoing messages.
50 1 Luca Baldesi
!!class_diagram.png!!
51 1 Luca Baldesi
52 1 Luca Baldesi
53 1 Luca Baldesi
h2. The Shaper