Network layer » History » Version 1

Version 1/2 - Next » - Current version
Luca Baldesi, 08/22/2017 04:05 PM

Network layer

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.
It exposes to the P2P application a very simple interface:

  • send a data buffer b from peer p1 to peer p2
  • receive a data buffer b from a remote peer p2 with the local peer p1

Currently the network layer, called net_helper_x, implements the following advanced features:

  • packet fragmentation: needed in order to deal with MTU
  • very basic loss-recovery: fragments can be requested in case of loss
  • data shaping: the data is forced to be sent regularly, avoiding traffic peaks

The modules implementing these features are called network_manager and shaper.

We refer with

  • "packet" the data buffer exchanged,
  • "fragment" the portion of packet
  • "message" to a fragment or a fragment request

net_helper_x sends and receives packet from the application layer and it sends and receives messages from the network.

The features listed above can be split in the following conceptual functionalities:

  • Sender side:
  • * Fragment outgoing packets
  • * Periodically send fragments
  • * Send fragments upon requests
  • * Flush old packet (defined by a threshold)
  • Receiver side:
  • * Enqueue incoming messages (either fragments or fragment requests)
  • * Pop completed messages
  • * Request fragments
  • * Flush old packet (defined by a threshold)

As additional requirements we want: * Fast look-up of data * * getting oldest packet * * getting specific packet (for fragment enqueuing) * * getting next message to be sent * Limit the number of data duplication

The Network Manager
The network manager is responsible of fragmenting/re-assembling of packets and it keeps the queue of outgoing messages.

The Shaper

class_diagram.png (18.5 KB) Luca Baldesi, 08/22/2017 04:03 PM