Serial Networking Protocol ========================== J.G.Harston - mdfs.net/Apps/Networking/SerialNet The Serial Networking protocol is a subset of the Serial Tube protocol. It encapsulated Econet packets to transmit over a serial connection, such as the BBC's serial port. Data is transmitted as bytes, with escaped embedded command sequences. , translates to a single byte, , is an escaped command sequence. Serial networking ----------------- The esc,&Ax sequence is reserved for networking over a serial link. This has been implemented in the SerialNet NFS ROM as follows. esc,&Ax marks the start or end of a Econet frame over a serial link as part of an Econet packet. It may be useful that the leading nybble is a 1010 sequence. The esc byte is normally &9B. esc,&Ax - %10100xxx - incoming esc,&Ax - %10101xxx - replies %1010000x - ScoutStart %1010100x - ScoutACK %1010001x - ScoutEnd %1010101x - ScoutNAK %1010010x - DataStart %1010110x - DataACK %1010011x - DataEnd %1010111x - DataNAK A standard 4-frame Econet packet is sent over a serial link as follows: Scout: +----------+---------------------------+---------+ |ScoutStart|Dest|Dest|Src|Src|Ctrl|Port|ScoutEnd | | esc,&A0 |Stn |Net |Stn|Net|Byte| | esc,&A2 | +----------+---------------------------+---------+ <--- - Packet Header - ---> Scout acknowledge sent back if dest has an open receive block: +---------+-----------------+--------+ |ScoutACK |Dest|Dest|Src|Src|ScoutEnd| | esc,&A8 |Stn |Net |Stn|Net|esc,&A2 | +---------+-----------------+--------+ Where Dest and Src are opposite to Scout frame Scout acknowledge sent back if dest does not have an open receive block: +---------+-----------------+--------+ |ScoutNAK |Dest|Dest|Src|Src|ScoutEnd| | esc,&AA |Stn |Net |Stn|Net| esc,&A2| +---------+-----------------+--------+ Where Dest and Src are opposite to Scout frame Data: +---------+-----------------+--------+-------+ |DataStart|Dest|Dest|Src|Src| Packet |DataEnd| | esc,&A4 |Stn |Net |Stn|Net| Data |esc,&A6| +---------+-----------------+--------+-------+ Data acknowledge sent back if receive block large enough: +---------+-----------------+-------+ | DataACK |Dest|Dest|Src|Src|DataEnd| | esc,&AC |Stn |Net |Stn|Net|esc,&A6| +---------+-----------------+-------+ Where Dest and Src are opposite to Data frame Data acknowledge sent back if receive block not large enough: +---------+-----------------+-------+ | DataNAK |Dest|Dest|Src|Src|DataEnd| | esc,&AE |Stn |Net |Stn|Net|esc,&A6| +---------+-----------------+-------+ Where Dest and Src are opposite to Data frame As with ADLC Econet, Immediate operations send an extended scout and return data immediately in an extended ScoutReply, and Broadcast transmissions consist solely of an extended Scout with eight bytes of payload. The net number is either &00 for 'this net', &FF for 'broadcast', or &7x for 'serial net' (expanding on &80-&FE for Ethernet), allowing the station at the other end of the link to translate the transaction to a wider network. Remember, all transmitted data is protected by sequences, so the following Econet packet: Scout from station 0.155 to station 120.254 on port &9B with control &80: +---------------------------+ |Dest|Dest|Src|Src|Ctrl|Port| |Stn |Net |Stn|Net|Byte| | |&FE |&78 |&9B|&00|&80 |&9B | +---------------------------+ <--- - Packet - ---> will appear on over the serial line as the following bytes: Scout: +----------+-----------------------------------+---------+ |ScoutStart|Dest|Dest| Src |Src|Ctrl | Port |ScoutEnd | | esc,&A0 |Stn |Net | Stn |Net|Byte | | esc,&A2 | | &9B,&A0 |&FE |&78 |&9B,&9B|&00| &80 |&9B,&9B| &9B,&A2 | +----------+-----------------------------------+---------+ <--- - - - Packet - - - ---> Any other sequences should be discarded, or passed on to a SerialTube client. See also -------- * mdfs.net/Software/Tube/Serial/Protocol for SerialNet protocol.