Forward packets in 5Greplay

This document details how 5Greplay forwards packets

5Greplay can forward raw packets as-is into the outgoing NIC using libpcap or DPDK (if the tool is compiled with DPDK).

The implementation is in src/forward folder.

To avoid packets being considered as duplication, then rejected by the endpoint’s protocol, 5Greplay supports to create a new stream between it and the endpoint, then use this stream to inject the packet’s payloads.

Currently it supports SCTP and UDP streams. The information of endpoints is given via a configuration file by using the following parameters:

  • list of stream protocols, for example, {SCTP,UDP}
  • IPs of the targets corresponding to each protocol
  • Port numbers of the targets corresponding to each protocol.


If we want to use a new SCTP connection to forward SCTP packets’ payloads, and other packets (including UDP ones) are forwarded as they-are, then we can use the following configuration:

	enable     = true
	output-nic = "lo"
	nb-copies  = 1
	snap-len   = 0
	promisc    = 1
	default    = DROP
	target-protocols = { SCTP }
	target-hosts     = { "" }
	target-ports     = { 38412 }

Using these config parameters, all the payloads of SCTP packets will be sent to at port 38412. The other packets (excluding the packets containing SCTP protocol) will be injected into lo interface.