1syntax = "proto3";
2
3package livekit;
4option go_package = "github.com/livekit/protocol/livekit";
5option csharp_namespace = "LiveKit.Proto";
6option ruby_package = "LiveKit::Proto";
7
8// internal protos, not exposed to clients
9import "livekit_models.proto";
10import "livekit_rtc.proto";
11import "livekit_room.proto";
12
13enum NodeType {
14 SERVER = 0;
15 CONTROLLER = 1;
16 MEDIA = 2;
17 TURN = 4;
18}
19
20enum NodeState {
21 STARTING_UP = 0;
22 SERVING = 1;
23 SHUTTING_DOWN = 2;
24}
25
26message Node {
27 string id = 1;
28 string ip = 2;
29 uint32 num_cpus = 3;
30 NodeStats stats = 4;
31 NodeType type = 5;
32 NodeState state = 6;
33 string region = 7;
34}
35
36message NodeStats {
37 // when server was started
38 int64 started_at = 1;
39 // when server last reported its status
40 int64 updated_at = 2;
41
42 // room
43 int32 num_rooms = 3;
44 int32 num_clients = 4;
45 int32 num_tracks_in = 5;
46 int32 num_tracks_out = 6;
47
48 // packet
49 uint64 bytes_in = 7;
50 uint64 bytes_out = 8;
51 uint64 packets_in = 9;
52 uint64 packets_out = 10;
53 uint64 nack_total = 11;
54 float bytes_in_per_sec = 12;
55 float bytes_out_per_sec = 13;
56 float packets_in_per_sec = 14;
57 float packets_out_per_sec = 15;
58 float nack_per_sec = 16;
59
60 // system
61 uint32 num_cpus = 17;
62 float load_avg_last1min = 18;
63 float load_avg_last5min = 19;
64 float load_avg_last15min = 20;
65 float cpu_load = 21;
66 uint32 sys_packets_out = 28;
67 uint32 sys_packets_dropped = 29;
68 float sys_packets_out_per_sec = 30;
69 float sys_packets_dropped_per_sec = 31;
70 float sys_packets_dropped_pct_per_sec = 32;
71
72 // retransmissions
73 uint64 retransmit_bytes_out = 22;
74 uint64 retransmit_packets_out = 23;
75 float retransmit_bytes_out_per_sec = 24;
76 float retransmit_packets_out_per_sec = 25;
77
78 // participant joins
79 uint64 participant_join = 26;
80 float participant_join_per_sec = 27;
81}
82
83// message to RTC nodes
84message RTCNodeMessage {
85 string participant_key = 1;
86 int64 sender_time = 11;
87 string connection_id = 13;
88 oneof message {
89 StartSession start_session = 2;
90 SignalRequest request = 3;
91 // internal messages
92 RoomParticipantIdentity remove_participant = 4;
93 MuteRoomTrackRequest mute_track = 5;
94 UpdateParticipantRequest update_participant = 6;
95 DeleteRoomRequest delete_room = 7;
96 UpdateSubscriptionsRequest update_subscriptions = 8;
97 SendDataRequest send_data = 9;
98 UpdateRoomMetadataRequest update_room_metadata = 10;
99 KeepAlive keep_alive = 12;
100 }
101}
102
103// message to Signal nodes
104message SignalNodeMessage {
105 string connection_id = 1;
106 oneof message {
107 SignalResponse response = 2;
108 EndSession end_session = 3;
109 }
110}
111
112message StartSession {
113 string room_name = 1;
114 string identity = 2;
115 string connection_id = 3;
116 // if a client is reconnecting (i.e. resume instead of restart)
117 bool reconnect = 4;
118 bool auto_subscribe = 9;
119 bool hidden = 10;
120 ClientInfo client = 11;
121 bool recorder = 12;
122 string name = 13;
123 // A user's ClaimGrants serialized in JSON
124 string grants_json = 14;
125 bool adaptive_stream = 15;
126 //if reconnect, client will set current sid
127 string participant_id = 16;
128}
129
130message EndSession {
131}
132
133message RemoveParticipant {
134 string participant_id = 1;
135}
136
137message KeepAlive {
138}