Protocol 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Coraid Ethernet Console (cec)
  2. Abstract
  3. The Coraid Ethernet Console (cec) implements a bidirectional conversation
  4. over raw ethernet frames with provisions for retransmission and discovery.
  5. Like serial consoles, each machine has a single shared interface per service
  6. type, but any number connections can be made from any machine connected to
  7. the same physical network. The communications from the various connections
  8. will be interleaved. The first implementation of cec is for console communications
  9. to Coraid appliances.
  10. Outline
  11. 1. Packet format
  12. 2. The Tdiscover packet and Toffer reply.
  13. 3. Initializing a connection. Tinit[abc]
  14. 4. The connection. Tdata and Tack
  15. 5. Closing the connection. Treset
  16. 1. Packet Format
  17. All cec packets are follow the layout implied by the following structure
  18. struct Pkt {
  19. uchar dst[6]; // destination ethernet address
  20. uchar src[6]; // source ethernet address
  21. uchar etype[2]; // service type
  22. uchar type; // type of packet.
  23. uchar conn; // unique connection id.
  24. uchar seq; // packet sequence number
  25. uchar len; // data length.
  26. uchar data[1500];
  27. };
  28. The packet types are as follows:
  29. enum {
  30. Tinita,
  31. Tinitb,
  32. Tinitc,
  33. Tdata,
  34. Tack,
  35. Tdiscover,
  36. Toffer,
  37. Treset,
  38. };
  39. 2. The Tdiscover packet and Toffer reply.
  40. The Tdiscover packet is used to discover the avaliable cec devices on the local
  41. network. The packet sent is of the form
  42. Tdiscover = {
  43. [dest] 0xffffffff,
  44. [src] mac of local interface,
  45. [etype] service type,
  46. [type] Tdiscover,
  47. [seq] 0,
  48. [len] 0,
  49. [data] 0,
  50. }
  51. The reply to the Tdiscover packet is of type Toffer which differes from
  52. Tdiscover in that data and len may be set. The contents of data is application
  53. specific.
  54. 3. Initializing a connection. Tinit[abc]
  55. A connection is initialized by the following conversation: In addition
  56. to the fields set for the Tdiscover packet, he client sends a packet
  57. of type Tinita with the conntag of its choice. The server responds to
  58. Tinita with a packet of type Tinitb. And finally the client sents a
  59. Tinitc packet back to the server, completing the connection.
  60. 4. The connection. Tdata and Tack
  61. Data is sent from the client to the console server with the Tdata packet.
  62. The seq field is incremented for each data packet sent. Thus data packets
  63. may be transmitted if lost. The data is whatever data the client has to
  64. send to the server, up to 1500 bytes. Typically, however, each keystroke
  65. is sent in a seperate packet. The len field is the length of the
  66. data.
  67. The server responds to a Tdata message with a Tack message with the
  68. same seq sequence number.
  69. 5. Closing the connection. Treset
  70. Either the server of the client may send a Treset message to close the
  71. connection. There is no response to a Treset message, however any
  72. information associated with that connection (conntag) is discarded
  73. when the Treset message is recieved.