nvflare.fuel.f3.sfm.prefix module¶
- class Prefix(length: int = 0, header_len: int = 0, type: int = 0, reserved: int = 0, flags: int = 0, app_id: int = 0, stream_id: int = 0, sequence: int = 0)[source]¶
Bases:
object
Prefix is the 16-byte fixed header for the SFM frame, every frame must have this prefix. Beside all the other attributes, it provides framing for the message. Framing is needed if the frame is sent over byte streams like TCP or sockets.
The 8 fields in the prefix are all integers encoded in big-endian,
length(4): Total length of the frame.
header_len(2): Length of the encoded headers
type(1): Frame type (DATA, HELLO etc)
reserved(1): Not used, 0
flags(2): Attribute of the frame (OOB, ACK etc).
app_id(2): Application ID to support multiple apps
stream_id(2): Stream ID to connect all fragments of a stream
sequence(2): A sequence number for each frame. Used to detect lost frames.
- app_id: int = 0¶
- flags: int = 0¶
- header_len: int = 0¶
- length: int = 0¶
- reserved: int = 0¶
- sequence: int = 0¶
- stream_id: int = 0¶
- type: int = 0¶