(msg_len)
return total_mpe_overhead + total_overhead + msg_len
Compute the number of bytes sent over-the-air (OTA) for an API message

    The API message is carried by Blocksat Packets, sent in the payload of UDP
    datagrams over IPv4, with a layer-2 MTU of 1500 bytes, and, ultimately,
    transported over MPE. If the message size is such that the UDP/IPv4 packet
    exceeds the layer-2 MTU, fragmentation is not handled at the IP level but
    instead at application layer, i.e., at the Blocksat Packet protocol level.

    Args:
        msg_len : Length of the API message to be transmitted
Compute the number of bytes sent over-the-air (OTA) for an API message
Compute the number of bytes sent over - the - air ( OTA ) for an API message
def calc_ota_msg_len(msg_len):
    """Compute the number of bytes sent over-the-air (OTA) for an API message

    The API message is carried by Blocksat Packets, sent in the payload of UDP
    datagrams over IPv4, with a layer-2 MTU of 1500 bytes, and, ultimately,
    transported over MPE. If the message size is such that the UDP/IPv4 packet
    exceeds the layer-2 MTU, fragmentation is not handled at the IP level but
    instead at application layer, i.e., at the Blocksat Packet protocol level.

    Args:
        msg_len : Length of the API message to be transmitted

    """
    # Is it going to be fragmented?
    n_frags = ceil(msg_len / MAX_PAYLOAD)

    # Including all fragments, the total Blocksat + UDP + IPv4 overhead is:
    total_overhead = (UDP_IP_HEADER + HEADER_LEN) * n_frags

    # Total overhead at MPE layer:
    mpe_header = 16
    total_mpe_overhead = mpe_header * n_frags

    return total_mpe_overhead + total_overhead + msg_len
def calc_ota_msg_len ( msg_len ) : # Is it going to be fragmented? n_frags = ceil ( msg_len / MAX_PAYLOAD ) # Including all fragments, the total Blocksat + UDP + IPv4 overhead is: total_overhead = ( UDP_IP_HEADER + HEADER_LEN ) * n_frags # Total overhead at MPE layer: mpe_header = 16 total_mpe_overhead = mpe_header * n_frags return total_mpe_overhead + total_overhead + msg_len