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). This 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

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
jump [instruction number]
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: