Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft public protos #414

Closed
wants to merge 1 commit into from
Closed

draft public protos #414

wants to merge 1 commit into from

Conversation

andymck
Copy link
Contributor

@andymck andymck commented Aug 22, 2024

No description provided.

enum public_record_type {
data = 0;
international_roaming_data = 1;
connection = 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren’t connections prerequisites of any other kind of record? Could counting these result in inflated numbers if a consumer were under the impression a “connection” were distinct from a data session?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connections and sessions are related but provide two distinct offerings to downstream services. They are also published at different cadences, with connections at a much faster cadence. We may or may not want to include connections in the public bucket but it is included for now as a 1-1 match for our internal feeds

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree it's valid to output both connections and "sessions" but it's redundant to have a public_cdr_connection_v1 which would logically always have a RecordType: PublicRecordType::Connection; the two "report" messages should be session_v1 and connection_v1 and then this record_type enum should be limited to use in the "session" messages with variants like "data", "international_roaming_data", etc. should we also account for "voice" and "text" traffic or is that not differentiated when being processed by hotspots?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, no need for RecordType in the connection proto. At this time I as I understand it we are only interested in outputting data record types

Copy link
Contributor

@jeffgrunewald jeffgrunewald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the “public” is redundant since the entire repo is public. I also think CDR is probably too specific to one particular carrier/mvno parlance


enum public_traffic_source {
helium_mobile = 0;
other = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any option for an “other” right now? We should avoid this catch all until we know we need it. If it’s for an “unknown” it should probably be the first option since that feels like a safer default value than attributing to any specific carrier/provider

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other is currently in use as a placeholder until a confirmed list of sources is provided

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need a placeholder when adding variants to a protobuf enum is fully backward compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a draft, its there as a placeholder until things are confirmed and should we end up omitting a source, then it will be designated as other

// origin of the cdr
public_traffic_source traffic_source = 4;
// the hotspot serial number
string agw_sn = 5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agw_sn probably too specific to helium mobile. hotspot_sn?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i also wonder if this is an opportunity to start distancing ourselves from the cruft of the "split identity" that a cbrs radio/hotspot pair comes with by collapsing the gateway_sn and radio_sn fields into a single hotspot_sn field which would have a oneof type and then the two variants of the oneof would be something like:

message radio_identity {
    string gateway_sn = 1;
    string radio_sn = 2;
}

message session_v1 {
    string id = 1;
    string pubkey = 2;
    oneof hotspot_id {
        string unified = 3;
        radio_identity split = 4;
    }
}

which would have some benefits when decoding/parsing the message into a language-native data type to immediately determine the type of hotspot/radio combo and avoid the need for things like handling options of strings in rust for the 99% of hotspots producing reports

@andymck
Copy link
Contributor Author

andymck commented Aug 22, 2024

public is in use in this draft to differentiate between the internal representations of the protos. Both internal and this public representation will be outputted by the same service

string radio_serial = 7;
// the cbsd_id of a cbrs radio
string cbsd_id = 8;
uint64 total_volume = 9;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please add some comment indicating the units for each type of usage volume? I believe these are all in bytes?

uint64 uplink_volume = 10;
uint64 downlink_volume = 11;
// timestamp in millisecs of when the record was created in the network
uint64 timestamp = 12;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optionally rename this to timestamp_ms? Could do similar for any other type which has a unit, so received_timestamp -> received_timestamp_ms etc would also be nice.

Copy link
Contributor

@jeffgrunewald jeffgrunewald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to differentiate the "publicly visible" session reports from the carrier-internal ones but avoid the "public" designation specifically since public is a keyword in proto3 (related to importing) and also a keyword in many languages that might be consuming these and could conceivably cause perceptual confusion even if it doesn't confuse any LSPs

enum public_record_type {
data = 0;
international_roaming_data = 1;
connection = 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree it's valid to output both connections and "sessions" but it's redundant to have a public_cdr_connection_v1 which would logically always have a RecordType: PublicRecordType::Connection; the two "report" messages should be session_v1 and connection_v1 and then this record_type enum should be limited to use in the "session" messages with variants like "data", "international_roaming_data", etc. should we also account for "voice" and "text" traffic or is that not differentiated when being processed by hotspots?


enum public_traffic_source {
helium_mobile = 0;
other = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need a placeholder when adding variants to a protobuf enum is fully backward compatible?

// origin of the cdr
public_traffic_source traffic_source = 4;
// the hotspot serial number
string agw_sn = 5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i also wonder if this is an opportunity to start distancing ourselves from the cruft of the "split identity" that a cbrs radio/hotspot pair comes with by collapsing the gateway_sn and radio_sn fields into a single hotspot_sn field which would have a oneof type and then the two variants of the oneof would be something like:

message radio_identity {
    string gateway_sn = 1;
    string radio_sn = 2;
}

message session_v1 {
    string id = 1;
    string pubkey = 2;
    oneof hotspot_id {
        string unified = 3;
        radio_identity split = 4;
    }
}

which would have some benefits when decoding/parsing the message into a language-native data type to immediately determine the type of hotspot/radio combo and avoid the need for things like handling options of strings in rust for the 99% of hotspots producing reports

@andymck andymck closed this Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants