IEEE 802.15.4 - асинхронный MAC CSMA

В этом примере показано, как симулировать IEEE® 802.15.4™ асинхронный CSMA MAC [1], пользующийся Библиотекой Communications Toolbox™ для Протокола ZigBee®.

Фон

Стандарт IEEE 802.15.4 задает слои MAC и PHY Беспроводных Персональных Сетей области С низкой ставкой (LR-WPANs) [1]. Слои IEEE 802.15.4 MAC и PHY обеспечивают основание других стандартов более высокого слоя, таких как ZigBee, WirelessHart®, 6LoWPAN и MiWi. Такие стандарты находят применение в домашней автоматизации и организации сети датчика и очень относятся к тренду Интернета вещей (IoT).

IEEE 802.15.4 MAC [1] задает 2D основные режимы MAC: (i) "не маяк включил", и (ii) поддерживающий маяк MAC. Включенный MAC немаяка является асинхронным CSMA (Обнаружение несущей Несколько доступ) MAC, который очень похож на MAC IEEE 802.11. Поддерживающий маяк MAC позволяет два различных периода MAC: (i) период MAC синхронизируемого CSMA и (ii) вставленный временем, период MAC без конкуренций. Этот пример обеспечивает, обширная симуляция "не маяка включила", асинхронный, основанный на CSMA MAC IEEE 802.15.4.

Сетевой Setup

PAN IEEE 802.15.4 (персональная сеть области) настраивается стандартным процессом между координаторами PAN и конечными устройствами. Во-первых, устройства, которые хотели бы соединить сеть, выполняют или активное или пассивное сканирование. Активное сканирование означает, что устройство сначала передает Запрос Маяка, и позже это выполняет пассивное сканирование. Сканирование пассивного элемента означает, что устройство осуществляет сниффинг, чтобы собрать кадры "неисправность" от координаторов PAN (кто, возможно, получил их Запрос Маяка в случае активного сканирования). На набор маяков во время пассивного сканирования конечное устройство выбирает PAN, с которым это хотело бы сопоставить. Затем это передает Запрос Ассоциации координатору этой PAN, и координатор подтверждает его.

В отличие от IEEE 802.11, координатор не следует за подтверждением Запроса Ассоциации с мгновенной передачей Ответа Ассоциации. Вместо этого координатор IEEE 802.15.4 сначала хранит Ответ Ассоциации локально; это только передается, когда конечное устройство отправляет Запрос Данных, и координатор подтверждает его. Стандарт IEEE 802.15.4 использует термин косвенная передача, чтобы относиться к этому механизму для передачи кадров. В общем случае этот механизм очень полезен для работающих от аккумулятора устройств сетей низкого трафика (например, сетей датчика). Такие устройства могут периодически активировать свои радио, чтобы проверять, находятся ли какие-либо системы координат на рассмотрении для них, вместо того, чтобы постоянно использовать их радио, чтобы сразу принять кадр.

Если ответ Ассоциации получен и подтвержден, конечное устройство сопоставлено с PAN. В то время системами координат данных можно обменяться между координатором и конечным устройством в любом направлении. Системы координат данных могут быть подтверждены, в зависимости от их 'индикации' Запроса Подтверждения.

Асинхронное Среднее Управление доступом (MAC)

Асинхронный MAC IEEE 802.15.4 CSMA похож на типовую операцию CSMA и MAC IEEE 802.11. В этой схеме MAC кадры подтверждения сразу передаются, не используя метод CSMA. Все другие кадры передаются с помощью CSMA.

А именно, если устройство имеет систему координат, чтобы передать, это случайным образом выбирает задержку возврата (количество периодов возврата) из области значений [0 2^BE-1], где BE является экспонентой возврата. Длительность каждого периода возврата является 20 символами. Для OQPSK PHY в 2,4 ГГц эта длительность соответствует 128 микросхемам и 0,32 мс. Если устройство ожидало выбранного количества периодов возврата, это выполняет поставщика услуг, распознающегося. Если носитель неактивен, устройство начинает передачу своей системы координат, пока это полностью не передается.

Если носитель занят во время обнаружения несущей, то шаг экспоненты возврата 1 и новое количество периодов возврата выбран из нового [0 2^BE-1] область значений. Когда счетчик возврата истекает снова, поставщик услуг, распознающийся, выполняется. Если максимальное количество обратных отсчетов возврата достигнуто без носителя, являющегося неактивным во время какого-либо поставщика услуг, обнаруживающего экземпляр, то устройство отключает свои попытки передать кадр.

Сетевые возможности симуляции

Этот пример предлагает реализацию для описанного сетевого процесса настройки и метода CSMA через lrwpan. MACFullFunctionDevice и lrwpan. Классы MACReducedFunctionDevice. А именно, следующие возможности включены:

  • Активное и пассивное сканирование

  • Запрос ассоциации и обмен Ответа Ассоциации

  • Косвенные передачи с помощью Запросов Данных

  • Структурируйте подтверждения и структурируйте повторные передачи, если подтверждения не своевременны полученный

  • Короткий и долгий межкадровый интервал (SIFS и LIFS)

  • Бинарная экспоненциальная задержка

  • Поставщик услуг, распознающийся

Сетевая симуляция

В этом разделе мы создаем сеть IEEE 802.15.4 3 узлов: один координатор PAN и два конечных устройства. Сетевое средство моделирования сконфигурировано, чтобы обработать все устройства в шаге одной длительности возврата (20 символов, 0,32 мс).

Во-первых, следующий код иллюстрирует ассоциацию первого устройства с сетью.

symbolsPerStep = 20;
chipsPerSymbol = 32;
samplesPerChip = 4;
symbolRate = 65.5e3; % symbols/sec
time = 0;
stopTime = 5; % sec

% Create PAN Coordinator
panCoordinator = lrwpan.MACFullFunctionDevice('PANCoordinator', true, 'SamplesPerChip', 4, ....
  'PANIdentifier', '7777', 'ExtendedAddress', [repmat('0', 1, 8) repmat('7', 1, 8)], ...
  'ShortAddress', '1234');

% Create first end-device:
endDevice1 = lrwpan.MACReducedFunctionDevice('SamplesPerChip', 4, ...
  'ShortAddress', '0001', 'ExtendedAddress', [repmat('0', 1, 8) repmat('3', 1, 8)]);

% Initialize device inputs
received1 = zeros(samplesPerChip * chipsPerSymbol * symbolsPerStep/2, 1);
received2 = zeros(samplesPerChip * chipsPerSymbol * symbolsPerStep/2, 1);

while time < stopTime
  % Pass the received signals to the nodes for processing. Also, fetch what
  % they have to transmit:
  transmitted1 = panCoordinator(received1);
  transmitted2 = endDevice1(received2);

  % Ideal wireless channel, where both nodes are within range:
  received1 = transmitted2; % half-duplex radios, none receiving while transmitting
  received2 = transmitted1;

  time = time + symbolsPerStep/symbolRate; % update clock
end
0001: ********* Adding Beacon Request frame to the queue
0001: Passive scanning for 1584 steps
0001: Processing next frame from the queue
0001: Initializing transmission; backoff delay = 1 steps
0001: Backoff delay = 1 steps -> 0 steps
0001: Carrier sensing: Medium is idle.
0001: Clear to transmit
0001: Transmitting Beacon Request
0001: IFS offset = 0 samples
0001: Transmitting 1-1280 of 2050
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
0001: IFS offset = 0 samples
0001: Transmitting 1281-2050 of 2050
0001: Finished transmission
0001: Need to wait for SIFS (12) symbols. Offset = 12, next IFS = 4
0001: Entering passive scanning
1234: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
1234: *********** Received frame type = MAC command
1234: *********** Received MAC Command type = Beacon request
1234: Need to wait for SIFS (12) symbols. Offset = 12, next IFS = 4
1234: ********* Adding Beacon frame to the queue
1234: next IFS = 4
1234: Processing next frame from the queue
1234: Initializing transmission; backoff delay = 7 steps
1234: Backoff delay = 7 steps -> 6 steps
1234: Backoff delay = 6 steps -> 5 steps
1234: Backoff delay = 5 steps -> 4 steps
1234: Backoff delay = 4 steps -> 3 steps
1234: Backoff delay = 3 steps -> 2 steps
1234: Backoff delay = 2 steps -> 1 steps
1234: Backoff delay = 1 steps -> 0 steps
1234: Carrier sensing: Medium is idle.
1234: Clear to transmit
1234: IFS offset = 256 samples
1234: Transmitting 1-1024 of 2562
1234: IFS offset = 0 samples
1234: Transmitting 1025-2304 of 2562
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
1234: IFS offset = 0 samples
1234: Transmitting 2305-2562 of 2562
1234: Finished transmission
1234: Need to wait for LIFS (40) symbols. Offset = 4, next IFS = 24
1234: Decreased wait time by 20 symbols to 4
0001: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
0001: *********** Received frame type = Beacon
0001: Need to wait for SIFS (12) symbols. Offset = 4, next IFS = -4
0001: next IFS = 0
0001: Scanning finished
0001: ********* Adding Association request frame to the queue
0001: Processing next frame from the queue
0001: Initializing transmission; backoff delay = 0 steps
0001: Carrier sensing: Medium is idle.
0001: Clear to transmit
0001: IFS offset = 0 samples
0001: Transmitting 1-1280 of 3458
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
0001: IFS offset = 0 samples
0001: Transmitting 1281-2560 of 3458
0001: IFS offset = 0 samples
0001: Transmitting 2561-3458 of 3458
0001: Finished transmission
0001: will wait for ack for 54 symbols additional to IFS = 0
1234: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
1234: *********** Received frame type = MAC command
1234: *********** Received MAC Command type = Association request
1234: Need to wait for LIFS (40) symbols. Offset = 14, next IFS = 34
1234: ********** Directly transmitting acknowledgement frame (no CSMA/CA)
1234: ********* Adding Data response frame to the PENDING queue
1234: next IFS = 34
0001: Decreasing ack wait durations by 20 symbols to 34
1234: IFS offset = 896 samples
1234: Transmitting 1-384 of 1410
0001: Decreasing ack wait durations by 20 symbols to 14
1234: IFS offset = 0 samples
1234: Transmitting 385-1410 of 1410
1234: Finished transmission
1234: Need to wait for SIFS (12) symbols. Offset = 16, next IFS = 8
0001: Decreasing ack wait durations by 20 symbols to -6
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
0001: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
0001: *********** Received frame type = Acknowledgment
0001: Need to wait for SIFS (12) symbols. Offset = 16, next IFS = 8
0001: *********** Adding Data request frame to the queue
0001: next IFS = 1920
0001: Decreased wait time by 20 symbols to 1900
0001: Decreased wait time by 20 symbols to 1880
0001: Decreased wait time by 20 symbols to 1860
0001: Decreased wait time by 20 symbols to 1840
0001: Decreased wait time by 20 symbols to 1820
0001: Decreased wait time by 20 symbols to 1800
0001: Decreased wait time by 20 symbols to 1780
0001: Decreased wait time by 20 symbols to 1760
0001: Decreased wait time by 20 symbols to 1740
0001: Decreased wait time by 20 symbols to 1720
0001: Decreased wait time by 20 symbols to 1700
0001: Decreased wait time by 20 symbols to 1680
0001: Decreased wait time by 20 symbols to 1660
0001: Decreased wait time by 20 symbols to 1640
0001: Decreased wait time by 20 symbols to 1620
0001: Decreased wait time by 20 symbols to 1600
0001: Decreased wait time by 20 symbols to 1580
0001: Decreased wait time by 20 symbols to 1560
0001: Decreased wait time by 20 symbols to 1540
0001: Decreased wait time by 20 symbols to 1520
0001: Decreased wait time by 20 symbols to 1500
0001: Decreased wait time by 20 symbols to 1480
0001: Decreased wait time by 20 symbols to 1460
0001: Decreased wait time by 20 symbols to 1440
0001: Decreased wait time by 20 symbols to 1420
0001: Decreased wait time by 20 symbols to 1400
0001: Decreased wait time by 20 symbols to 1380
0001: Decreased wait time by 20 symbols to 1360
0001: Decreased wait time by 20 symbols to 1340
0001: Decreased wait time by 20 symbols to 1320
0001: Decreased wait time by 20 symbols to 1300
0001: Decreased wait time by 20 symbols to 1280
0001: Decreased wait time by 20 symbols to 1260
0001: Decreased wait time by 20 symbols to 1240
0001: Decreased wait time by 20 symbols to 1220
0001: Decreased wait time by 20 symbols to 1200
0001: Decreased wait time by 20 symbols to 1180
0001: Decreased wait time by 20 symbols to 1160
0001: Decreased wait time by 20 symbols to 1140
0001: Decreased wait time by 20 symbols to 1120
0001: Decreased wait time by 20 symbols to 1100
0001: Decreased wait time by 20 symbols to 1080
0001: Decreased wait time by 20 symbols to 1060
0001: Decreased wait time by 20 symbols to 1040
0001: Decreased wait time by 20 symbols to 1020
0001: Decreased wait time by 20 symbols to 1000
0001: Decreased wait time by 20 symbols to 980
0001: Decreased wait time by 20 symbols to 960
0001: Decreased wait time by 20 symbols to 940
0001: Decreased wait time by 20 symbols to 920
0001: Decreased wait time by 20 symbols to 900
0001: Decreased wait time by 20 symbols to 880
0001: Decreased wait time by 20 symbols to 860
0001: Decreased wait time by 20 symbols to 840
0001: Decreased wait time by 20 symbols to 820
0001: Decreased wait time by 20 symbols to 800
0001: Decreased wait time by 20 symbols to 780
0001: Decreased wait time by 20 symbols to 760
0001: Decreased wait time by 20 symbols to 740
0001: Decreased wait time by 20 symbols to 720
0001: Decreased wait time by 20 symbols to 700
0001: Decreased wait time by 20 symbols to 680
0001: Decreased wait time by 20 symbols to 660
0001: Decreased wait time by 20 symbols to 640
0001: Decreased wait time by 20 symbols to 620
0001: Decreased wait time by 20 symbols to 600
0001: Decreased wait time by 20 symbols to 580
0001: Decreased wait time by 20 symbols to 560
0001: Decreased wait time by 20 symbols to 540
0001: Decreased wait time by 20 symbols to 520
0001: Decreased wait time by 20 symbols to 500
0001: Decreased wait time by 20 symbols to 480
0001: Decreased wait time by 20 symbols to 460
0001: Decreased wait time by 20 symbols to 440
0001: Decreased wait time by 20 symbols to 420
0001: Decreased wait time by 20 symbols to 400
0001: Decreased wait time by 20 symbols to 380
0001: Decreased wait time by 20 symbols to 360
0001: Decreased wait time by 20 symbols to 340
0001: Decreased wait time by 20 symbols to 320
0001: Decreased wait time by 20 symbols to 300
0001: Decreased wait time by 20 symbols to 280
0001: Decreased wait time by 20 symbols to 260
0001: Decreased wait time by 20 symbols to 240
0001: Decreased wait time by 20 symbols to 220
0001: Decreased wait time by 20 symbols to 200
0001: Decreased wait time by 20 symbols to 180
0001: Decreased wait time by 20 symbols to 160
0001: Decreased wait time by 20 symbols to 140
0001: Decreased wait time by 20 symbols to 120
0001: Decreased wait time by 20 symbols to 100
0001: Decreased wait time by 20 symbols to 80
0001: Decreased wait time by 20 symbols to 60
0001: Decreased wait time by 20 symbols to 40
0001: Decreased wait time by 20 symbols to 20
0001: Decreased wait time by 20 symbols to 0
0001: Processing next frame from the queue
0001: Initializing transmission; backoff delay = 2 steps
0001: Backoff delay = 2 steps -> 1 steps
0001: Backoff delay = 1 steps -> 0 steps
0001: Carrier sensing: Medium is idle.
0001: Clear to transmit
0001: IFS offset = 0 samples
0001: Transmitting 1-1280 of 3074
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
0001: IFS offset = 0 samples
0001: Transmitting 1281-2560 of 3074
0001: IFS offset = 0 samples
0001: Transmitting 2561-3074 of 3074
0001: Finished transmission
0001: will wait for ack for 54 symbols additional to IFS = 0
1234: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
1234: *********** Received frame type = MAC command
1234: *********** Received MAC Command type = Data request
1234: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0
1234: ********** Directly transmitting acknowledgement frame (no CSMA/CA)
1234: Moving frame for 0000000033333333 from pending queue to the transmission queue
1234: next IFS = 0
1234: IFS offset = 0 samples
1234: Transmitting 1-1280 of 1410
0001: Decreasing ack wait durations by 20 symbols to 34
1234: IFS offset = 0 samples
1234: Transmitting 1281-1410 of 1410
1234: Finished transmission
1234: Need to wait for SIFS (12) symbols. Offset = 2, next IFS = -6
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
0001: Decreasing ack wait durations by 20 symbols to 14
1234: Processing next frame from the queue
1234: Initializing transmission; backoff delay = 5 steps
1234: Backoff delay = 5 steps -> 4 steps
0001: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
0001: *********** Received frame type = Acknowledgment
0001: Need to wait for SIFS (12) symbols. Offset = 2, next IFS = -6
0001: next IFS = 0
1234: Backoff delay = 4 steps -> 3 steps
1234: Backoff delay = 3 steps -> 2 steps
1234: Backoff delay = 2 steps -> 1 steps
1234: Backoff delay = 1 steps -> 0 steps
1234: Carrier sensing: Medium is idle.
1234: Clear to transmit
1234: IFS offset = 0 samples
1234: Transmitting 1-1280 of 4226
1234: IFS offset = 0 samples
1234: Transmitting 1281-2560 of 4226
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
1234: IFS offset = 0 samples
1234: Transmitting 2561-3840 of 4226
1234: IFS offset = 0 samples
1234: Transmitting 3841-4226 of 4226
1234: Finished transmission
1234: will wait for ack for 54 symbols additional to IFS = 0
1234: Decreasing ack wait durations by 20 symbols to 34
0001: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
0001: *********** Received frame type = MAC command
0001: *********** Received MAC Command type = Association response
0001: Need to wait for LIFS (40) symbols. Offset = 6, next IFS = 26
0001: *********** Association successful, changing short address to = 8CEC
8CEC: *********** Association successful, associated to PAN = 7777
8CEC: ********** Directly transmitting acknowledgement frame (no CSMA/CA)
8CEC: next IFS = 26
1234: Decreasing ack wait durations by 20 symbols to 14
8CEC: IFS offset = 384 samples
8CEC: Transmitting 1-896 of 1410
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
1234: Decreasing ack wait durations by 20 symbols to -6
8CEC: IFS offset = 0 samples
8CEC: Transmitting 897-1410 of 1410
8CEC: Finished transmission
8CEC: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0
1234: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
1234: *********** Received frame type = Acknowledgment
1234: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0
1234: next IFS = 0
8CEC: ********* (t=4.079360) Injecting data frame to the queue. From: 8CEC -> To: 1234 
8CEC: Processing next frame from the queue
8CEC: Initializing transmission; backoff delay = 6 steps
8CEC: Backoff delay = 6 steps -> 5 steps
8CEC: Backoff delay = 5 steps -> 4 steps
8CEC: Backoff delay = 4 steps -> 3 steps
8CEC: Backoff delay = 3 steps -> 2 steps
8CEC: Backoff delay = 2 steps -> 1 steps
8CEC: Backoff delay = 1 steps -> 0 steps
8CEC: Carrier sensing: Medium is idle.
8CEC: Clear to transmit
8CEC: IFS offset = 0 samples
8CEC: Transmitting 1-1280 of 8578
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
8CEC: IFS offset = 0 samples
8CEC: Transmitting 1281-2560 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 2561-3840 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 3841-5120 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 5121-6400 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 6401-7680 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 7681-8578 of 8578
8CEC: Finished transmission
8CEC: will wait for ack for 54 symbols additional to IFS = 0
1234: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
1234: *********** Received frame type = Data
1234: Need to wait for SIFS (12) symbols. Offset = 14, next IFS = 6
1234: ********** Directly transmitting acknowledgement frame (no CSMA/CA)
1234: next IFS = 6
1234: IFS offset = 384 samples
1234: Transmitting 1-896 of 1410
8CEC: Decreasing ack wait durations by 20 symbols to 34
1234: IFS offset = 0 samples
1234: Transmitting 897-1410 of 1410
1234: Finished transmission
1234: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
8CEC: Decreasing ack wait durations by 20 symbols to 14
8CEC: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
8CEC: *********** Received frame type = Acknowledgment
8CEC: Need to wait for LIFS (40) symbols. Offset = 8, next IFS = 28
8CEC: next IFS = 28
8CEC: Decreased wait time by 20 symbols to 8
8CEC: ********* (t=4.795200) Injecting data frame to the queue. From: 8CEC -> To: 1234 
8CEC: Processing next frame from the queue
8CEC: Initializing transmission; backoff delay = 6 steps
8CEC: Backoff delay = 6 steps -> 5 steps
8CEC: Backoff delay = 5 steps -> 4 steps
8CEC: Backoff delay = 4 steps -> 3 steps
8CEC: Backoff delay = 3 steps -> 2 steps
8CEC: Backoff delay = 2 steps -> 1 steps
8CEC: Backoff delay = 1 steps -> 0 steps
8CEC: Carrier sensing: Medium is idle.
8CEC: Clear to transmit
8CEC: IFS offset = 512 samples
8CEC: Transmitting 1-768 of 8578
Found preamble of OQPSK PHY.
8CEC: IFS offset = 0 samples
8CEC: Transmitting 769-2048 of 8578
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
8CEC: IFS offset = 0 samples
8CEC: Transmitting 2049-3328 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 3329-4608 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 4609-5888 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 5889-7168 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 7169-8448 of 8578
8CEC: IFS offset = 0 samples
8CEC: Transmitting 8449-8578 of 8578
8CEC: Finished transmission
8CEC: will wait for ack for 54 symbols additional to IFS = 0
1234: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
1234: *********** Received frame type = Data
1234: Need to wait for SIFS (12) symbols. Offset = 2, next IFS = -6
1234: ********** Directly transmitting acknowledgement frame (no CSMA/CA)
1234: next IFS = 0
1234: IFS offset = 0 samples
1234: Transmitting 1-1280 of 1410
8CEC: Decreasing ack wait durations by 20 symbols to 34
1234: IFS offset = 0 samples
1234: Transmitting 1281-1410 of 1410
1234: Finished transmission
1234: Need to wait for SIFS (12) symbols. Offset = 2, next IFS = -6
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
8CEC: Decreasing ack wait durations by 20 symbols to 14
8CEC: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
8CEC: *********** Received frame type = Acknowledgment
8CEC: Need to wait for LIFS (40) symbols. Offset = 2, next IFS = 22
8CEC: next IFS = 22
8CEC: Decreased wait time by 20 symbols to 2
1234: ********* (t=5.001280) Injecting data frame to the queue. From: 1234 -> To: 8CEC 
1234: Processing next frame from the queue
1234: Initializing transmission; backoff delay = 1 steps
1234: Backoff delay = 1 steps -> 0 steps
1234: Carrier sensing: Medium is idle.
1234: Clear to transmit
1234: IFS offset = 0 samples
1234: Transmitting 1-1280 of 8578
1234: IFS offset = 0 samples
1234: Transmitting 1281-2560 of 8578
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
1234: IFS offset = 0 samples
1234: Transmitting 2561-3840 of 8578
1234: IFS offset = 0 samples
1234: Transmitting 3841-5120 of 8578
1234: IFS offset = 0 samples
1234: Transmitting 5121-6400 of 8578
1234: IFS offset = 0 samples
1234: Transmitting 6401-7680 of 8578
1234: IFS offset = 0 samples
1234: Transmitting 7681-8578 of 8578
1234: Finished transmission
1234: will wait for ack for 54 symbols additional to IFS = 0
1234: Decreasing ack wait durations by 20 symbols to 34
8CEC: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
8CEC: *********** Received frame type = Data
8CEC: Need to wait for SIFS (12) symbols. Offset = 14, next IFS = 6
8CEC: ********** Directly transmitting acknowledgement frame (no CSMA/CA)
8CEC: next IFS = 6
8CEC: IFS offset = 384 samples
8CEC: Transmitting 1-896 of 1410
Found preamble of OQPSK PHY.
Found start-of-frame delimiter (SFD) of OQPSK PHY.
1234: Decreasing ack wait durations by 20 symbols to 14
8CEC: IFS offset = 0 samples
8CEC: Transmitting 897-1410 of 1410
8CEC: Finished transmission
8CEC: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0
1234: PHY decoded IEEE 802.15.4 frame
CRC check passed for the MAC frame.
1234: *********** Received frame type = Acknowledgment
1234: Need to wait for LIFS (40) symbols. Offset = 8, next IFS = 28
1234: next IFS = 28
1234: Decreased wait time by 20 symbols to 8

Если 1-е конечное устройство было сопоставлено, системы координат данных случайным образом введены в ссылку между конечным устройством и Координатором PAN.

Затем третье устройство соединяет PAN, и системами координат данных впоследствии обмениваются между координатором и обоими конечными устройствами, звездообразным способом топологии (конечные устройства должны только передать кадры координаторам). В этом случае выход подавлен.

% Create second end-device:
endDevice2 = lrwpan.MACReducedFunctionDevice('SamplesPerChip', 4, ...
  'ShortAddress', '0002', 'ExtendedAddress', [repmat('0', 1, 8) repmat('4', 1, 8)], 'Verbosity', false);
% Suppress detailed output:
endDevice1.Verbosity = false;
panCoordinator.Verbosity = false;

% Initialize input
received3 = zeros(samplesPerChip * chipsPerSymbol * symbolsPerStep/2, 1);

stopTime = 10; % sec
while time < stopTime
  % Pass the received signals to the nodes for processing. Also, fetch what
  % they have to transmit:
  transmitted1 = panCoordinator(received1);
  transmitted2 = endDevice1(received2);
  transmitted3 = endDevice2(received3);

  % Ideal wireless channel, where all nodes are within range:
  received1 = transmitted2 + transmitted3; % half-duplex radios, none receiving while transmitting
  received2 = transmitted1 + transmitted3;
  received3 = transmitted1 + transmitted2;

  time = time + symbolsPerStep/symbolRate; % update clock
end

Больше узлов может быть добавлено к сети, пока отношение канала устанавливается соответственно (т.е. полученные сигналы как функция переданных сигналов).

Дальнейшее исследование

Можно далее исследовать следующий генератор и декодирующие функции, а также объект настройки:

Выбранная библиография

  1. IEEE 802.15.4-2011 - Стандарт IEEE для Локальных сетей и городских компьютерных сетей - Часть 15.4: Беспроводные Персональные Сети области С низкой ставкой (LR-WPANs)

Для просмотра документации необходимо авторизоваться на сайте