Create the documentation for the NETRAVE Packet Exchange Protocol
2.3 KiB
Netrave Packet Exchange Protocol (NPEP)
Overview
NPEP is a custom protocol designed for the NETRAVE project to facilitate communication between the Orchestrator and the Packet Processor Consumers. It is designed to be lightweight, efficient, and secure.
Message Types
NPEP supports the following message types:
-
REQUEST
: Used by a consumer to request a new pcap chunk from the Orchestrator or to request permission to output a processed pcap chunk. The format isREQUEST {CONSUMER_ID} {REQUEST_TYPE} {PCAP_CHUNK_ID}
where{REQUEST_TYPE}
can be eitherNEW
for a new pcap chunk orOUTPUT
for output permission. -
UPSTATE
: Used by a consumer to update its state in the Orchestrator. The format isUPSTATE {CONSUMER_ID} {STATE} {PCAP_CHUNK_ID}
where{STATE}
is the current state of the consumer. The states can beRECEIVED
,PROCESSING
,STASIS
, orAT_REST
. -
FINISHED
: Used by a consumer to inform the Orchestrator that it has finished processing a pcap chunk. The format isFINISHED {CONSUMER_ID} {PCAP_CHUNK_ID}
. -
CHANGE
: Used by the Orchestrator to request a consumer to change its state. The format isCHANGE {CONSUMER_ID} {STATE} {URGENCY}
where{STATE}
is the state the Orchestrator wants the consumer to change to and{URGENCY}
is the urgency level of the state change request. The urgency levels can bePLS
(Please),SOON
, orNOW
. -
SHUTDOWN
: Used by the Orchestrator to request a consumer to shut down. The format isSHUTDOWN {CONSUMER_ID} {URGENCY}
where{URGENCY}
is the urgency level of the shutdown request. The urgency levels can bePLS
(Please),SOON
, orNOW
.
Security
To ensure only legitimate consumers can connect to the Orchestrator, a unique {HASH}
is generated by the Orchestrator and used to authenticate each consumer. This {HASH}
is included in the REQUEST
message.
Error Handling
If a consumer crashes or disconnects unexpectedly, the Orchestrator will detect this through a lack of heartbeat messages and reassign the pcap chunk to another consumer.
Data Transmission
NPEP is designed to transmit pcap data in its raw binary form to minimize overhead and maximize efficiency. The Orchestrator sends pcap data to the consumers using the SEND PCAP {PCAP_CHUNK_ID} {PCAP_DATA}
message, where {PCAP_DATA}
is the raw pcap data.