Skip to content

silicondsp/combined-link-physical-layer-sim

Repository files navigation

combined-link-physical-layer-sim

Capsim® Capability to Model and Simulate Combined Link Layer and Physical Layer Communication Systems.

sdsp logo

Linux Tux Developed on Linux.

 


Icons link github, link buildingCredit the Noun Project.

Item

Description

Link

Type

1

Capsim® Combined Link and Physical Layer Block Diagram Modeling and Simulation

link

Analysis and Results

2

Capsim® Combined Link and Physical Layer QAM Codec

link

Analysis and Results

3

Link Layer and IEEE 802.11a Physical Layer

link

Modeling and Simulation Results

4

Building Capsim® for Link and Physical Layer Modeling and Simulation

link building

Instructions

5

Capsim® Text Mode Kernel (TMK) Installation

GitHub Repository

6

GitHub Repository Capsim® Combined Link Layer and Physical Layer Block Diagram Modeling and Simulation

GitHub Repository





Copyright (c) 1993-2007 Silicon DSP Corporation
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts, and
no Back-Cover Texts. A copy of the license is included in the
section entitled "GNU Free Documentation License". 

Combined Physical and Link Level Simulation in Capsim®

December 1,1993

 

Figures

 

Introduction

Capsim® can simultaneously simulate the combined physical and link layers. This is accomplished using Capsim buffers which can input and output samples asynchronously. Also it is very easy to specify the buffer data units to be bits, vectors, floating point samples or any data structure. This is done without any modification of the Capsim® kernel.

A further requirement in the combined asynchronous and synchronous data flow simulation of the link and physical layers, is that the number of data units on buffers is random and in fact are a function of bit errors generated by noise in the physical layer.

Thus, if 4096 bits are transmitted and received in an error free protocol, the buffers in the Capsim® simulation may have generated many times that number of bits which depends on re-transmissions due to noise.

The purpose of the following application note is to illustrate the above concepts with the Capsim® simulation of an error free data transmission system with HDLC frames and ARQ.

Capsim® Block Diagram

 

Simulation Topology Description

The topology of an error free digital transmission system is shown in the Figure. The idea is to generate digital data, form HDLC frames, transmit the frames over a physical layer, receive the HDLC frames, check for errors and acknowledge or request retransmission of the frame.

The datagen block generates a fixed number of bits upon request. That is, if the input buffer, marked request to send in the topology, has a sample then the block generates N bits where N is the number of bits in the HDLC payload.

The N bits are packaged into an HDLC frame with the txhdlc block. However, this block checks the ACK/NAK buffer to determine if it needs to retransmit a frame or send a new frame. It also gets the sequence number mod 8 of the frame in error. Thus, it buffers up to 8 frames. The HDLC frame is sent through the physical layer which is always a hierarchical block. The received decoded bits, with possible bit errors, are received by the rxhdlc block. This complex block checks for frame check errors and generates negative acknowledgments(NAK) with sequence numbers or positive acknowledgments(ACK). The block also must check for errors in the start and ending frame flags, and also for abort conditions. Every possible scenario must be checked by this block. The rxhdlc block outputs vectors of bytes as data structures. The data structure contains the length of the payload and a pointer to the bytes of data. The block v2b converts the vectors to a bit stream. The desired format of the received data depends on the application.

In the topology the fxdelay block has auto fan-out so its outputs are replicates of the delayed input. However, the delay in this case is set to zero. Note that both integer and floating point and vector buffers are simultaneously used in the simulation.

The block rts filters the ACK signals from the NAK and passes them to the datagen block. This effectively achieves data flow control. Since, the datagen block should only generate N bits of payload data on positive acknowledgments. For negative acknowledgments, the txhdlc block retransmits queued frames.

 

Simulation Results

A number of results for analysing the effects of payload length on system performance are provided. These results are from Capsim® simulations. Simulation results were entered into Excel spread sheets and the charts are actually Excel charts.


Total frames transmitted and correct frames received versus payload size in bits.

Total transmitted bits versus payload size in bits.

Efficiency versus versus payload size in bits no noise.

Efficiency versus payload size in bits noisy channel.

The following is a plot of the acknowledgment signal directly from Capsim® and the IIPPlot Java Plotting Program. Values above 140 indicate negative ack. The payload was 256 bits, the BER=0.0038 and the total number of information bits transmitted was 12000. Note the modulo 8 frame number. From this plot it is clear that the number of samples on the buffers is random and depends on the physical layer noise level. This is only possible with asynchronous data flow.

Receiver Acknowledgment, 12000 information bits, 256 bit Payload

Capsim V.29 Constellation Physical Layer

v29 constellation

Combined Physical and Link Level Simulation in Capsim® Multi-Rate QAM CODEC

The combined Link and Physical Layer has been extended to employ a Physical Layer using Quadrature Amplitude Modulation (QAM). The block diagram is shown below. Two blocks are used for modeling and simulation:

  • mapper_11a.s
  • demap_bits_11a.s

The blocks generate the same QAM constellations as the IEEE 892.11a OFDM system. Different constellations including BPSK, QPSK , 16QAM and 64 QAM can be generated and demodulated.

The blocks are supplied with the GitHub repository.



Capsim® Block Diagram

combined qam block diagram



16 QAM with Noise Power Level 0.013

16 QAM noise

In the following simulation results the number of information bits is 4096 and the payload size is 128.

Plot showing ACK and NAK (Request_To_Send.tim)

ARQ ACK/NAK

Console Report on the Simulation

%../capsim  arq_qam_4.t
Welcome to Capsim Text Mode Kernel (CapsimTMK)
(c)1989-2017 Silicon DSP Corporation
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
http://www.silicondsp.com
Version 6.2
Running topology arq_qam_4.t
model name: arq_qam_4
TxHDLC: number of outputted frames=81
TxHDLC: number of bits outputted =9817
scatter created file: Scatter.sct 
RxHDLC: number of received frames=81
RxHDLC: number of bits received 9816
RxHDLC: number of errors =17
RxHDLC: number of correct frames =64
plot created file: RX_Ack.tim 
plot created file: Request_To_Send.tim 

Analysis of the Impact of Packet Payload Size on Efficiencty


The plot below shows the results of multiple simulations where the payload size is changed. The size of the information bits is 4096 bits. The x axis is the frame size. The y axis is the total number of bits sent in order to finally send the 4096 information bits error free. In all cases the Bit Error Rate (BER) was around 0.0015. For all cases the noise power was the same. The payloads were {8,16,32,64,128,192,256,320,384,448,512,576,640,704,832,960,1024 } bits. The plot shows the range of preferred payload sizes. At larger payloads the efficincy increases with no noise, But due to noise, in this case, and bit errors, the larger packets get hit and fail to pass requiring retransmission which reduces efficiency. At smaller payloads the efficiency also decreases due to higher overhead and also more hits as more packets are sent.

The raw results of the simulation are provided in a text file in the repository here.

combined performance QAM

IEEE 802.11a Combined Link and Phyical Layer

Noisy case with retransmission

ARQ With IEEE 802.11a Physical Layer No Noise

Capsim® makes possible the combined simulation of MAC layer and the Physical Layer. In the following example, 5000 information bits are sent as 5 HDLC packets with 1000 bit payloads.

As can be seen in the console, since the noise was zero, all packets were received correctly with no retransmissions required. See the noisy case were retransmissions are required.



ARQ With IEEE 802.11a Physical Layer With Noise

In the following example 5000 information bits are transmitted as HDLC packets with 1000 bit payloads. Due to noise, two retransmissions were required. See the console report in the snapshot. A total of 7 packets are sent. Five are received without error and two are received with error due to noise in the channel and the fact that the Physical Layer could not correct the errors.

Note that two retransmissions are shown in the plot.



Instructions for Running Capsim® Combined Link and Physical Layer Block Diagram Simulation.

1- Obtain the Capsim® Text Mode Kernel (CapsimTMK) for Linux from:

GitHub Capsim Text Mode Repository

CapsimTMK is distributed with all the blocks that are needed for modeling and simulating the combined link and physical layer topologies except for blocks supporting Multi Rate (MR) QAM Codec which are distributed with this GitHub repository.

This Repository contains the Topologies for combined link and physical layer block diagram modeling inlcuding the blocks for the Multi Rate QAM Codec.

Note: Follow the Getting Started Guidelines in the CapsimTMK Repository.

2- Once CapsimTMK is installed just run 'make' in this directory (in this repository): Capsim

3- Then change to the directory 'Topologies' and run:

../capsim arq_qam_4.t

4- For the V.29 Codec run:

../capsim arq_v29.t

The console will show the results of the simulation.

5- To show the ACK and NAK for the ARQ simulation plot the file: Request_To_Send.tim

6- To show the constellation, plot the file: Scatter.sct

Use the plotting tool provided with the CapsimTMK repository:

java -jar $CAPSIM/TOOLS/IIPPlot.jar Request_To_Send.tim

java -jar $CAPSIM/TOOLS/IIPPlot.jar -scatter Scatter.sct

Note that for the .tim plot set the style to Bar.

With Linux you can send the plot application to run in the background to put plots side by side when you want to display multiple plots. Then bring them to the forgound and use Control C to exit.



About

Capsim capability to model and simulate combined link layer and physical layer communication systems.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published