Part 1
요약·해설
Segment pool 수명, Transmitter 7개 state, Receiver 5개 state와 timer formula 10개를 설명합니다.
Up to 32
Up to 384 octets
7 TX · 5 RX
Config since Mesh 1.1
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
D596774669E88D6207AD6E02F9A5C7B1EED974AFAECA8BD719C2E31B63834589
.. _bluetooth_mesh_sar_cfg:
Segmentation and reassembly (SAR)
#################################
Segmentation and reassembly (SAR) provides a way of handling larger upper transport layer messages
in a mesh network, with a purpose of enhancing the Bluetooth Mesh throughput. The segmentation and
reassembly mechanism is used by the lower transport layer.
The lower transport layer defines how the upper transport layer PDUs are segmented and reassembled
into multiple Lower Transport PDUs, and sends them to the lower transport layer on a peer device.
If the Upper Transport PDU fits, it is sent in a single Lower Transport PDU. For longer packets,
which do not fit into a single Lower Transport PDU, the lower transport layer performs segmentation,
splitting the Upper Transport
PDU into multiple segments.
The lower transport layer on the receiving device reassembles the segments into a single Upper
Transport PDU before passing it up the stack. Delivery of a segmented message is acknowledged by the
lower transport layer of the receiving node, while an unsegmented message delivery is not
acknowledged. However, an Upper Transport PDU that fits into one Lower Transport PDU can also be
sent as a single-segment segmented message when acknowledgment by the lower transport layer is
required. Set the ``send rel`` flag (see :c:struct:`bt_mesh_msg_ctx`) to use the reliable message
transmission and acknowledge single-segment segmented messages.
The transport layer is able to transport up to 32 segments with its SAR mechanism, with a maximum
message (PDU) size of 384 octets. To configure message size for the Bluetooth Mesh stack, use the
following Kconfig options:
* :kconfig:option:`CONFIG_BT_MESH_RX_SEG_MAX` to set the maximum number of segments in an incoming message.
* :kconfig:option:`CONFIG_BT_MESH_TX_SEG_MAX` to set the maximum number of segments in an outgoing message.
The Kconfig options :kconfig:option:`CONFIG_BT_MESH_TX_SEG_MSG_COUNT` and
:kconfig:option:`CONFIG_BT_MESH_RX_SEG_MSG_COUNT` define how many outgoing and incoming segmented
messages can be processed simultaneously. When more than one segmented message is sent to the same
destination, the messages are queued and sent one at a time.
Incoming and outgoing segmented messages share the same pool for allocation of their segments. This
pool size is configured through the :kconfig:option:`CONFIG_BT_MESH_SEG_BUFS` Kconfig option.
Both incoming and outgoing messages allocate segments at the start of the transaction. The outgoing
segmented message releases its segments one by one as soon as they are acknowledged by the receiver,
while the incoming message releases the segments first after the message is fully received.
Keep this in mind when defining the size of the buffers.
SAR does not impose extra overhead on the access layer payload per segment.
Segmentation and reassembly (SAR) Configuration models
******************************************************
With Bluetooth Mesh Protocol Specification version 1.1, it became possible to configure SAR
behavior, such as intervals, timers and retransmission counters, over a mesh network using SAR
Configuration models:
* :ref:`bluetooth_mesh_sar_cfg_cli`
* :ref:`bluetooth_mesh_sar_cfg_srv`
The following SAR behavior applies regardless of the presence of a SAR Configuration Server on a
node.
Transmission of segments is separated by a segment transmission interval (see the
`SAR Segment Interval Step`_ state). Other configurable time intervals and delays available for the
segmentation and reassembly are:
* Interval between unicast retransmissions (see the states `SAR Unicast Retransmissions Interval Step`_ and `SAR Unicast Retransmissions Interval Increment`_).
* Interval between multicast retransmissions (see the `SAR Multicast Retransmissions Interval Step`_ state).
* Segment reception interval (see the `SAR Receiver Segment Interval Step`_ state).
* Acknowledgment delay increment (see the `SAR Acknowledgment Delay Increment`_ state).
When the last segment marked as unacknowledged is transmitted, the lower transport layer starts a
retransmissions timer. The initial value of the SAR Unicast Retransmissions timer depends on the
value of the TTL field of the message. If the TTL field value is greater than ``0``, the initial
value for the timer is set according to the following formula:
.. math::
unicast~retransmissions~interval~step + unicast~retransmissions~interval~increment \times (TTL - 1)
If the TTL field value is ``0``, the initial value of the timer is set to the unicast
retransmissions interval step.
The initial value of the SAR Multicast Retransmissions timer is set to the multicast retransmissions
interval.
When the lower transport layer receives a message segment, it starts a SAR Discard timer. The
discard timer tells how long the lower transport layer waits before discarding the segmented message
the segment belongs to. The initial value of the SAR Discard timer is the discard timeout value
indicated by the `SAR Discard Timeout`_ state.
SAR Acknowledgment timer holds the time before a Segment Acknowledgment message is sent for a
received segment. The initial value of the SAR Acknowledgment timer is calculated using the
following formula:
.. math::
min(SegN + 0.5 , acknowledgment~delay~increment) \times segment~reception~interval
The ``SegN`` field value identifies the total number of segments the Upper Transport PDU is
segmented into.
Four counters are related to SAR behavior:
* Two unicast retransmissions counts (see `SAR Unicast Retransmissions Count`_ state and `SAR Unicast Retransmissions Without Progress Count`_ state)
* Multicast retransmissions count (see `SAR Multicast Retransmissions Count`_ state)
* Acknowledgment retransmissions count (see `SAR Acknowledgment Retransmissions Count`_ state)
If the number of segments in the transmission is higher than the value of the
`SAR Segments Threshold`_ state, Segment Acknowledgment messages are retransmitted using the value
of the `SAR Acknowledgment Retransmissions Count`_ state.
.. _bt_mesh_sar_cfg_states:
SAR states
**********
There are two states defined related to segmentation and reassembly:
* SAR Transmitter state
* SAR Receiver state
The SAR Transmitter state is a composite state that controls the number and timing of transmissions
of segmented messages. It includes the following states:
* SAR Segment Interval Step
* SAR Unicast Retransmissions Count
* SAR Unicast Retransmissions Without Progress Count
* SAR Unicast Retransmissions Interval Step
* SAR Unicast Retransmissions Interval Increment
* SAR Multicast Retransmissions Count
* SAR Multicast Retransmissions Interval Step
The SAR Receiver state is a composite state that controls the number and timing of Segment
Acknowledgment transmissions and the discarding of reassembly of a segmented message. It includes
the following states:
* SAR Segments Threshold
* SAR Discard Timeout
* SAR Acknowledgment Delay Increment
* SAR Acknowledgment Retransmissions Count
* SAR Receiver Segment Interval Step
SAR Segment Interval Step
=========================
SAR Segment Interval Step state holds a value that controls the interval between transmissions of
segments of a segmented message. The interval is measured in milliseconds.
Use the :kconfig:option:`CONFIG_BT_MESH_SAR_TX_SEG_INT_STEP` Kconfig option to set the default
value. Segment transmission interval is then calculated using the following formula:
.. math::
(\mathtt{CONFIG\_BT\_MESH\_SAR\_TX\_SEG\_INT\_STEP} + 1) \times 10~\text{ms}
SAR Unicast Retransmissions Count
=================================
SAR Unicast Retransmissions Count holds a value that defines the maximum number of retransmissions
of a segmented message to a unicast destination. Use the
:kconfig:option:`CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_COUNT` Kconfig option to set the default
value for this state.
SAR Unicast Retransmissions Without Progress Count
==================================================
This state holds a value that defines the maximum number of retransmissions of a segmented message
to a unicast address that will be sent if no acknowledgment was received during the timeout, or if
an acknowledgment with already confirmed segments was received. Use the Kconfig option
:kconfig:option:`CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_WITHOUT_PROG_COUNT` to set the maximum number
of retransmissions.
SAR Unicast Retransmissions Interval Step
=========================================
The value of this state controls the interval step used for delaying the retransmissions of
unacknowledged segments of a segmented message to a unicast address. The interval step is measured
in milliseconds.
Use the :kconfig:option:`CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_STEP` Kconfig option to set the
default value. This value is then used to calculate the interval step using the following formula:
.. math::
(\mathtt{CONFIG\_BT\_MESH\_SAR\_TX\_UNICAST\_RETRANS\_INT\_STEP} + 1) \times 25~\text{ms}
SAR Unicast Retransmissions Interval Increment
==============================================
SAR Unicast Retransmissions Interval Increment holds a value that controls the interval increment
used for delaying the retransmissions of unacknowledged segments of a segmented message to a unicast
address. The increment is measured in milliseconds.
Use the Kconfig option :kconfig:option:`CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_INC` to set the
default value. The Kconfig option value is used to calculate the increment using the following
formula:
.. math::
(\mathtt{CONFIG\_BT\_MESH\_SAR\_TX\_UNICAST\_RETRANS\_INT\_INC} + 1) \times 25~\text{ms}
SAR Multicast Retransmissions Count
===================================
The state holds a value that controls the total number of retransmissions of a segmented message to
a multicast address. Use the Kconfig option
:kconfig:option:`CONFIG_BT_MESH_SAR_TX_MULTICAST_RETRANS_COUNT` to set the total number of
retransmissions.
SAR Multicast Retransmissions Interval Step
===========================================
This state holds a value that controls the interval between retransmissions of all segments in a
segmented message to a multicast address. The interval is measured in milliseconds.
Use the Kconfig option :kconfig:option:`CONFIG_BT_MESH_SAR_TX_MULTICAST_RETRANS_INT` to set the
default value that is used to calculate the interval using the following formula:
.. math::
(\mathtt{CONFIG\_BT\_MESH\_SAR\_TX\_MULTICAST\_RETRANS\_INT} + 1) \times 25~\text{ms}
SAR Discard Timeout
===================
The value of this state defines the time in seconds that the lower transport layer waits after
receiving segments of a segmented message before discarding that segmented message. Use the Kconfig
option :kconfig:option:`CONFIG_BT_MESH_SAR_RX_DISCARD_TIMEOUT` to set the default value. The discard
timeout will be calculated using the following formula:
.. math::
(\mathtt{CONFIG\_BT\_MESH\_SAR\_RX\_DISCARD\_TIMEOUT} + 1) \times 5~\text{seconds}
SAR Acknowledgment Delay Increment
==================================
This state holds a value that controls the delay increment of an interval used for delaying the
transmission of an acknowledgment message after receiving a new segment. The increment is measured
in segments.
Use the Kconfig option :kconfig:option:`CONFIG_BT_MESH_SAR_RX_ACK_DELAY_INC` to set the default
value. The increment value is calculated to be
:math:`\verb|CONFIG_BT_MESH_SAR_RX_ACK_DELAY_INC| + 1.5`.
SAR Segments Threshold
======================
SAR Segments Threshold state holds a value that defines a threshold in number of segments of a
segmented message for acknowledgment retransmissions. Use the Kconfig option
:kconfig:option:`CONFIG_BT_MESH_SAR_RX_SEG_THRESHOLD` to set the threshold.
When the number of segments of a segmented message is above this threshold, the stack will
additionally retransmit every acknowledgment message the number of times given by the value of
:kconfig:option:`CONFIG_BT_MESH_SAR_RX_ACK_RETRANS_COUNT`.
SAR Acknowledgment Retransmissions Count
========================================
The SAR Acknowledgment Retransmissions Count state controls the number of retransmissions of Segment
Acknowledgment messages sent by the lower transport layer. It gives the total number of
retranmissions of an acknowledgment message that the stack will additionally send when the size of
segments in a segmented message is above the :kconfig:option:`CONFIG_BT_MESH_SAR_RX_SEG_THRESHOLD`
value.
Use the Kconfig option :kconfig:option:`CONFIG_BT_MESH_SAR_RX_ACK_RETRANS_COUNT` to set the default
value for this state. The maximum number of transmissions of a Segment Acknowledgment message is
:math:`\verb|CONFIG_BT_MESH_SAR_RX_ACK_RETRANS_COUNT| + 1`.
SAR Receiver Segment Interval Step
==================================
The SAR Receiver Segment Interval Step defines the segments reception interval step used for
delaying the transmission of an acknowledgment message after receiving a new segment. The interval
is measured in milliseconds.
Use the Kconfig option :kconfig:option:`CONFIG_BT_MESH_SAR_RX_SEG_INT_STEP` to set the default value
and calculate the interval using the following formula:
.. math::
(\mathtt{CONFIG\_BT\_MESH\_SAR\_RX\_SEG\_INT\_STEP} + 1) \times 10~\text{ms}
Part 3
한국어 전문 번역
Segmentation and Reassembly
SAR은 mesh network에서 큰 upper transport layer message를 처리해 Bluetooth Mesh throughput을 높이는 lower transport layer mechanism입니다.
Lower transport layer는 Upper Transport PDU를 여러 Lower Transport PDU로 segment하고 peer의 lower transport layer로 보냅니다. Upper Transport PDU가 들어가면 하나의 Lower Transport PDU로 보내고, 길면 여러 segment로 나눕니다.
수신 device의 lower transport layer는 segment를 하나의 Upper Transport PDU로 reassemble한 뒤 stack 위로 전달합니다. Segmented message는 lower transport layer가 acknowledgment하지만 unsegmented message는 acknowledgment하지 않습니다.
하나의 Lower Transport PDU에 들어가는 Upper Transport PDU도 lower transport acknowledgment가 필요하면 single-segment segmented message로 보낼 수 있습니다. bt_mesh_msg_ctx의 send rel flag를 설정합니다.
크기와 동시 처리
SAR은 최대 32개 segment, 최대 384 octet message를 전송합니다.
CONFIG_BT_MESH_RX_SEG_MAX: Incoming message의 최대 segment 수CONFIG_BT_MESH_TX_SEG_MAX: Outgoing message의 최대 segment 수CONFIG_BT_MESH_TX_SEG_MSG_COUNT: 동시에 처리할 outgoing segmented message 수CONFIG_BT_MESH_RX_SEG_MSG_COUNT: 동시에 처리할 incoming segmented message 수
같은 destination에 segmented message를 여러 개 보내면 queue에 넣고 하나씩 전송합니다.
Segment buffer pool
Incoming·outgoing segmented message는 CONFIG_BT_MESH_SEG_BUFS로 정한 같은 segment allocation pool을 공유합니다. 양쪽 모두 transaction 시작 때 segment를 할당합니다.
Outgoing message는 receiver가 acknowledgment하는 즉시 segment를 하나씩 반환하지만 incoming message는 전체 message를 받은 뒤에야 segment를 반환합니다. Buffer pool 크기를 정할 때 이 차이를 고려해야 합니다. SAR은 access layer payload에 segment별 추가 overhead를 부과하지 않습니다.
SAR Configuration model
Bluetooth Mesh Protocol Specification 1.1부터 SAR Configuration Client·Server로 interval, timer와 retransmission counter를 network를 통해 구성할 수 있습니다. 아래 SAR behavior는 Server 존재 여부와 관계없이 적용됩니다.
Segment 송신은 SAR Segment Interval Step이 정한 간격으로 분리됩니다. Unicast retransmission interval, multicast retransmission interval, segment reception interval과 acknowledgment delay increment도 구성할 수 있습니다.
Timer 계산
마지막 unacknowledged segment를 보내면 lower transport layer가 retransmission timer를 시작합니다. TTL이 0보다 크면 SAR Unicast Retransmissions timer 초기값은 다음과 같습니다.
unicast retransmissions interval step + unicast retransmissions interval increment × (TTL - 1)TTL이 0이면 initial value는 unicast retransmissions interval step입니다. SAR Multicast Retransmissions timer initial value는 multicast retransmissions interval입니다.
Message segment를 받으면 SAR Discard timer를 시작하고 SAR Discard Timeout state가 지정한 시간 뒤 incomplete segmented message를 버립니다.
SAR Acknowledgment timer는 segment 수신 뒤 Segment Acknowledgment를 보내기 전까지의 시간이며 다음과 같이 계산합니다.
min(SegN + 0.5, acknowledgment delay increment) × segment reception intervalSegN은 Upper Transport PDU를 나눈 전체 segment 수를 식별합니다.
Counter
- Unicast retransmissions count
- Unicast retransmissions without progress count
- Multicast retransmissions count
- Acknowledgment retransmissions count
전송 segment 수가 SAR Segments Threshold보다 크면 SAR Acknowledgment Retransmissions Count에 따라 Segment Acknowledgment를 재전송합니다.
SAR state
SAR에는 Transmitter와 Receiver 두 composite state가 있습니다.
SAR Transmitter state
Segmented message 송신 횟수와 timing을 제어합니다.
- SAR Segment Interval Step
- SAR Unicast Retransmissions Count
- SAR Unicast Retransmissions Without Progress Count
- SAR Unicast Retransmissions Interval Step
- SAR Unicast Retransmissions Interval Increment
- SAR Multicast Retransmissions Count
- SAR Multicast Retransmissions Interval Step
SAR Receiver state
Segment Acknowledgment 송신 횟수·timing과 segmented message reassembly 폐기를 제어합니다.
- SAR Segments Threshold
- SAR Discard Timeout
- SAR Acknowledgment Delay Increment
- SAR Acknowledgment Retransmissions Count
- SAR Receiver Segment Interval Step
SAR Segment Interval Step
Segmented message의 segment 송신 간격을 millisecond 단위로 제어합니다. Default는 CONFIG_BT_MESH_SAR_TX_SEG_INT_STEP으로 정합니다.
(CONFIG_BT_MESH_SAR_TX_SEG_INT_STEP + 1) × 10 msSAR Unicast Retransmissions Count
Unicast destination에 segmented message를 재전송할 최대 횟수입니다. CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_COUNT가 default를 정합니다.
SAR Unicast Retransmissions Without Progress Count
Timeout 동안 acknowledgment를 받지 못했거나 이미 확인한 segment만 담은 acknowledgment를 받았을 때 unicast segmented message를 재전송할 최대 횟수입니다. CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_WITHOUT_PROG_COUNT로 정합니다.
SAR Unicast Retransmissions Interval Step
Unicast address로 보낸 segmented message의 unacknowledged segment 재전송을 지연하는 interval step입니다. CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_STEP이 default를 정합니다.
(CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_STEP + 1) × 25 msSAR Unicast Retransmissions Interval Increment
Unicast unacknowledged segment 재전송 지연에 더하는 millisecond increment입니다. CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_INC로 정합니다.
(CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_INC + 1) × 25 msSAR Multicast Retransmissions Count
Multicast address로 segmented message를 재전송할 총 횟수입니다. CONFIG_BT_MESH_SAR_TX_MULTICAST_RETRANS_COUNT로 정합니다.
SAR Multicast Retransmissions Interval Step
Multicast address에 segmented message의 모든 segment를 재전송하는 간격입니다. CONFIG_BT_MESH_SAR_TX_MULTICAST_RETRANS_INT로 정합니다.
(CONFIG_BT_MESH_SAR_TX_MULTICAST_RETRANS_INT + 1) × 25 msSAR Discard Timeout
Lower transport layer가 segmented message segment를 받은 뒤 incomplete message를 버릴 때까지 기다리는 시간입니다. CONFIG_BT_MESH_SAR_RX_DISCARD_TIMEOUT으로 정합니다.
(CONFIG_BT_MESH_SAR_RX_DISCARD_TIMEOUT + 1) × 5 secondsSAR Acknowledgment Delay Increment
새 segment를 받은 뒤 acknowledgment 송신을 지연하는 interval increment이며 segment 단위로 측정합니다. Default는 CONFIG_BT_MESH_SAR_RX_ACK_DELAY_INC입니다.
CONFIG_BT_MESH_SAR_RX_ACK_DELAY_INC + 1.5SAR Segments Threshold
Acknowledgment retransmission을 적용할 segmented message의 segment 수 threshold입니다. CONFIG_BT_MESH_SAR_RX_SEG_THRESHOLD로 정합니다.
Segment 수가 threshold보다 크면 stack이 각 acknowledgment를 CONFIG_BT_MESH_SAR_RX_ACK_RETRANS_COUNT만큼 추가 재전송합니다.
SAR Acknowledgment Retransmissions Count
Lower transport layer가 보내는 Segment Acknowledgment의 추가 재전송 횟수입니다. Default는 CONFIG_BT_MESH_SAR_RX_ACK_RETRANS_COUNT입니다.
maximum Segment Acknowledgment transmissions = CONFIG_BT_MESH_SAR_RX_ACK_RETRANS_COUNT + 1SAR Receiver Segment Interval Step
새 segment를 받은 뒤 acknowledgment 송신을 지연하는 segment reception interval step입니다. CONFIG_BT_MESH_SAR_RX_SEG_INT_STEP으로 정합니다.
(CONFIG_BT_MESH_SAR_RX_SEG_INT_STEP + 1) × 10 ms
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.