Packet Processing

Inlab Scheme implements a Packet Processing subsystem, also simply called and referenced as the Packet Processor.

Packet Processing Ports

The basic notion is a virtual networking device which consists of a number of ports (like a switch, for example). These packet processing ports are numbered starting from 0 up to the hard coded maximum number minus 1.

Packet processing ports are starting with index 0, therefore port 0 is the first port.

Packet Processing Port Types

PPortTypeNIC

PPortTypeTAP

PPortTypeUDP

The Packet Processing Register Machine

Port specific Data

Packet and Byte Counters
atomic_ullong bytes_received;
atomic_ullong packets_received;
atomic_ullong bytes_sent;
atomic_ullong packets_sent;
The Packet Processing Program
pthread_rwlock_t programlock;
PPMInstructionLine program[PPMMAXPROGRAMLEN];
Default UDP address and port for outgoing Packets
struct in6_addr default_outudpaddr;
int default_outudpport;

Packet specific PPRM Registers

typedef struct {
  int                 ic;          

  int                 inport;
  struct in6_addr*    inudpaddr;
  int                 inudpport;

  int                 outport;
  struct in6_addr*    outudpaddr;
  int                 outudpport;

  unsigned char*      packet;
  int                 packetlen;
} PPMRegisters;

PPRM Program

PPRM instructions

end

This instruction ends the execution of the PPRM progam finishing the processing of the current packet.

jump [instruction number]

This instruction sets the IC register to the specified value and thus performs a jump to this location.

noop
out
setoutport [port number]

Packet Processing Procedures

All packet processing functionality and the control of the PP register machine is done by the following set of packet processing procedures:

Children