14 pipeline stages in OPNET Wireless Simulation


overview

The biggest difference between wireless systems and wired networks is the broadcast and time-varying characteristics of wireless channels, as well as the mobility of nodes. The content of wireless channel modeling involves a wide range, including frequency, power, line-of-sight and interference of wireless channels. If the wireless channel is not accurately described, it will directly affect the performance of high-level layers and the accuracy of simulation.
For each transmit channel and receive channel pair, the entire wireless transmission process between them can be described by a combination of a series of single-function sub-transmission stages, which are a series of parameter calculations involved in simulating wireless links. The parameters of some wireless links are mutually causal, and there is a sequence in time, so the sequence of the transmission phase should also be determined according to the actual transmission sequence. In the OPNET wireless simulation, 14 end-to-end pipeline stages are used to simulate the transmission of data frames in the channel as closely as possible. First, before the entire transmission process is carried out, delineate the objects that must not be received; after calculating the transmission delay, then copy the packet, and make a copy of each object in the receiving main inquiry; then calculate the receiving block and check Whether the channel is completely matched, if it is completely matched, it is regarded as a valid signal, if it is partially matched, it is treated as noise; for the receiver, after experiencing the propagation delay, an internal interrupt is generated, and each possible received channel is processed 6~13 stage, since each segment of the packet may have different degrees of interference, each segment needs to be calculated separately. If it is a valid packet, calculate the bit error rate, and if it is noise, consider the impact on the effective packet; The number of bit errors determines whether to drop packets.
During the whole process, the calculation data is saved in the TDA (Transmission Data Attribute) of the package. TDA presets some values, such as the Objid of a certain transmitter and transmitter channel. These values ​​have a total of OPC_TDA_RA_MAX_INDEX, which is a symbolic name defined by OPNET, representing the maximum index number of the TDA attribute. If you need to customize the TDA attribute, define the new attribute as OPC_TDA_RA_MAX_INDEX plus 1, and so on.
The modeling process of the wireless channel in OPNET includes 14 single-function sub-stages, that is, the pipeline stage. The 14 pipeline stages are: receiving the main query (receiver group); transmission delay (sending delay); physical reachability (link blocking); channel matching; transmit antenna gain; propagation delay; receive antenna gain; receive power; interference noise; background noise; signal-to-noise ratio; bit error rate; error distribution; error correction.
In the receiving main inquiry stage, calculate all possible receiving nodes of each sending node; in the transmission delay stage, calculate the time difference between the first bit and the last bit of the data packet to start transmitting; in the link closing stage, judge whether the receiving node is physically reachable; in the channel matching stage Classify the transmission according to the channel; the transmit/receive antenna gain stage calculates the gain provided by the antenna of the send/receive node; the propagation delay stage calculates the time elapsed by the data packet from the send node to the receive node; the receive power stage calculates the signal arriving at the receive node The power value of the power value; the background noise and interference noise stage calculates the interference signal power; the signal-to-noise ratio stage calculates the average signal-to-noise ratio of the arriving data packet; the bit error rate stage obtains the bit error probability according to the signal-to-noise ratio; the error distribution stage calculates according to the bit error rate The number of bit errors in a data packet segment; the error correction stage determines whether to receive the data packet and forward it to the receiver adjacent module.
The C files corresponding to each stage are shown in the table below.

stage C file
Receive main inquiry dra_rxgroup.ps.c
transmission delay dra_txdel.ps.c
physical accessibility dra_closure.ps.c
channel matching dra_chanmatch.ps.c
Transmitter Antenna Gain dra_tagain.ps.c
propagation delay dra_propdel.ps.c
Receiver Antenna Gain dra_ragain.ps.c
received power dra_power.ps.c
Interference noise power dra_inoise.ps.c
background noise power dra_bkgnoise.ps.c
SNR dra_snr.ps.c
bit error rate dra_ber.ps.c
error distribution dra_error.ps.c
error correction dra_ecc.ps.c

Stage 0: Receive main query

This pipeline stage determines candidate receiver objects, excludes objects that obviously do not match, and circles out objects that are definitely not acceptable. In some network models, the simulation kernel can judge that the communication between the sending and receiving channel pairs is completely impossible. letter machine. Therefore, removing the receive channel from the receive query of the transmitter channel can speed up the simulation, since it reduces the duplication of packets and the execution of subsequent pipeline stages, without affecting the actual simulation effect. Specifically, OPNET establishes a pipeline transmission stage for each pair of transmitters and receivers. For each pair of receivers, the original data packet is copied once, because the copy of the packet is for each possible pair of transceivers. Each replicated packet needs to go through 13 pipeline stages. Even for the receiver pair inside the module, if the receiver has not been deleted from the receiver group in the receiver group, and the channel matching stage can be passed, then the data packet sent by itself will be blocked by itself. received. This situation is obviously not desired, so some standard receive main query pipeline stage procedures in OPNET exclude this situation.
As shown in the figure below, before the Tx node transmits the data packet, it checks that the receiving main inquiry list contains Rx0, Rx1 and Rx3, but Rx2 is not included, so the packet is only copied three times and sent to Rx0, Rx1 and Rx3 respectively, instead of Send to Rx2.
Please add a picture description
The simulation kernel passes the Objids of the send and receive channels to the pipeline stage program, which then returns an integer value (OPC_TRUE or OPC_FALSE) to the kernel indicating whether the receiver channel is a suitable destination and should be included in the In the receiving group. The TD class core functions can be used to change the default receiver group properties, and to dynamically change and recalculate the receiver group for simulation events.
The receiving group stage can also be completely skipped, as long as the rxgroup model is set to dra_no_rxgroup, but skipping does not mean that the pipeline stage is not used at all, but the receiving group is dynamically updated. This can speed up the simulation operation, especially for network simulation with heavy wireless traffic load.


Stage 1: Transmission delay

The transmission delay is a part of the delay experienced by the data packet in the wireless link. It is the time required for the packet to be sent at the channel rate. This time is the time between the first bit of the data packet and the last bit. The difference is also the simulation time used by the transmitter to process the data packet, and the channel is in a busy state during this process. When this event occurs, the media access layer data packets will wait in the queue until the channel is free to send the next data packet.
The schematic diagram of transmission delay is shown in the figure below.
insert image description here
Transmission delay = data packet length data transmission rate \frac{data packet length}{data transmission rate}data transfer ratepacket length

Calculation of transmission delay is the first stage of the entire pipeline stage. This stage is only calculated once for each packet , and the result is written into the TX_DELAY attribute of the packet TDA.


Stage 2: Physical Accessibility

The speed of simulation operation can be accelerated by judging the physical accessibility of the wireless link, and its function is somewhat similar to the pipeline stage of the receiver unit. If there is any obstruction on the link, the packet will be discarded, and the subsequent pipeline stage does not need to be calculated, otherwise, set PROP_CLOSURE to OPC_FALSE, indicating that there is no obstruction.
The physical accessibility calculation of the wireless link is determined based on the visibility. Based on physical considerations, it is tested whether the connection between the transmitter and the receiver is blocked by obstacles. If the sender and receiver are physically unreachable, packet transmission fails. Specific topographic maps can be configured in the simulation, and the calculation results of different topography and geomorphology are also different.


Stage 3: Channel matching

According to the four attributes of the transmitting station and the receiving station, such as frequency, bandwidth, data rate, and spreading code, it is judged whether the channel matches, and the data packets being transmitted are divided into three categories, as shown in the figure below.
insert image description here
(1) Valid data packet (valid): The attributes of the receiving station and the transmitting station are completely matched, and the receiving station can correctly receive and decode the currently transmitted data packet.
(2) Interference data packet (noise): In-band interference, the frequency and bandwidth of the transmitting station and the receiving station overlap, the data packet can not be decoded and used correctly, but also interferes with the reception of other data packets.
(3) Ignore data packets (ignore): Out-of-band data packets, the frequency bands do not cross. That is, the attributes such as the frequency and bandwidth of the receiver are completely inconsistent with those of the transmitting station. Although the data packet cannot be correctly decoded and utilized, it will not interfere with the reception of other data packets and will be destroyed by the simulation core.


Stage 4: Transmitter Antenna Gain

Transmitting antenna gain describes the phenomenon that the transmitted signal energy is amplified or attenuated. The shaping of the transmission power is based on the physical characteristics of the antenna structure and the azimuth angle of transmission. Since the antenna attenuates the power of the transmitted data packets in different directions, it directly affects the received power of the packet, and then affects the signal-to-noise ratio and The number of bit errors, the influence of the antenna model will be considered in the wireless link simulation.
In the actual simulation, to obtain the gain of the antenna, the antenna elevation angle must be obtained first. The calculation of the antenna elevation angle involves the transformation of coordinates. The transformation of coordinates depends on the reference point of the antenna. Rotate the Z-axis of the antenna model coordinate system to align with the reference point. Then project the connected vector of the transmitting station and the receiving station onto the coordinate system of the rotated antenna model to obtain the elevation angle of the antenna, and then find the antenna gain value in the direction of the link.
The connectivity vector between the transmitting station and the receiving station (that is, the angle between the sending end and the receiving end) can be calculated according to the location of the antenna (antenna attributes contain location information: target latitude, target longitude, target height). When the node moves, these three attributes need to be updated manually. According to these three physical location attributes, the simulation core will automatically update the current antenna coordinates.


Stage 5: Propagation Delay

Propagation delay corresponds to transmission delay, which is another part of the delay experienced by data packets in the wireless link. In a wireless link simulation, the transmission distance between the transmitting station and the receiving station may change during the packet transmission, taking into account the movement of the radio station. Therefore, two delays need to be calculated, namely the propagation delay at the beginning of the transmission and the propagation delay at the end of the transmission, to approximate the mobility characteristics of the node, as shown in the figure below.
insert image description here
Calculate the distances between the transmitting station and the receiving station for the start of the transmission and the end of the transmission, respectively.

Propagation start delay = distance between transceivers at the beginning of transmission Electromagnetic wave propagation rate \frac{Distance between transceivers at the beginning of transmission}{Electromagnetic wave propagation rate}Electromagnetic Wave Propagation VelocityTransceiver-to-transceiver distance

Propagation end delay = distance between transceivers at the end of transmission Electromagnetic wave propagation rate \frac{Distance between transceivers at the end of transmission}{Electromagnetic wave propagation rate}Electromagnetic Wave Propagation VelocityTransceiver-to-transceiver distance

The propagation delay is a compromise between the propagation start delay and the propagation end delay. Data from this stage are also used to calculate the Doppler shift.
insert image description here


Stage 6: Receiver Antenna Gain

This pipeline stage must wait until the propagation delay is over before executing, and the intermediate emulation cores will move on to handle other events. The receiver antenna gain is calculated in exactly the same way as the transmit antenna gain, and the result will be written to the RX_GAIN attribute under TDA.


Stage 7: Receive power

Received power is the effective power at which a valid data packet reaches the receiving station. According to the reference frequency and bandwidth of the transmitting station and the receiving station, the overlapping bandwidth of the transmitting and receiving stations is obtained. Calculate the transmission wavelength from the frequency, and then calculate the electromagnetic wave power propagation loss in free space according to the wireless propagation distance.
There are two types of anti-interference receiving methods: signal lock and power lock.
Signal lock means that the receiver determines that the packet that arrives first is the packet that should be received, and during the reception of this packet, the signal lock of the channel is set to 1, indicating that the channel is being occupied, and other arriving packets are considered interference. The semaphore lock is an internal variable introduced by the pipeline stage to prevent the receiving channel from correctly receiving multiple packets at the same time.
In the process of receiving a valid packet, another packet arrives, the signal of the packet that arrives first is locked, and the packet that arrives later is regarded as noise regardless of whether it is valid or noisy, as shown in the figure below.
insert image description here
Power lock means that the receiver determines that the packet with the highest power should be received, and other arriving packets with less power than the packet are considered interference, regardless of the order in which the packets arrive.


Stage 8: Disturbing noise power

The interference noise power describes the interaction between the various data packets arriving at the receiving channel at the same time. Interference occurs if a valid packet arrives on the destination channel while another packet is being received, or if a packet is being received while another packet arrives on the destination channel.
In most cases, the above two situations may occur multiple times in a data packet receiving process. During reception, for all interference powers, results are applied to received packets. Although the background noise power is only estimated once for each packet transmission, the interference noise power may be calculated multiple times. If multiple data packets interfere with each other, the interference power needs to be accumulated. Calculates the interference noise generated by all collisions for a frame. Mutual interference needs to be calculated when two frames collide. If the two frames are both legal frames, add the received power of the other party to its own interference accumulation, and if it is a noise frame, add its received power to the interference accumulation of the other party.
Interference noise can be generated in the following three situations.
insert image description here
Another valid packet came while a valid packet was received; a noisy packet came while a valid packet was received; a valid packet came while a noisy packet was received.


Stage 9: Background noise power

Typical background noise sources include thermal or radio noise from nearby electronic components or radio emissions. For example, the impact of vehicle radio, interference radio, TV or other equipment noise, etc., the impact of rain or other weather conditions.
Background Noise Power = Ambient Noise Power + Background Thermal Noise Power
Ambient Noise Power = Bandwidth × Power Spectral Density
Background Thermal Noise Power = Bandwidth × Boltzmann’s Constant × (Background Temperature + Equipment Temperature)
Background Noise Calculation of thermal noise and ambient noise, Convert the temperature of the receiver into equivalent noise through calculation, add the environmental noise, and select the part falling in the band as the background noise.


Stage 10: Signal-to-Noise Ratio

The signal-to-noise ratio is calculated based on parameters such as received power, background noise, and interference noise obtained through previous calculations.
The SNR value of a data packet is an important performance measure to judge whether the receiving station correctly received the contents of the packet. During the entire receiving process of a data packet, there may be multiple arrivals of other packets, forming new interference power, and the signal-to-noise ratio must be evaluated every time interference is formed. The signal-to-noise ratio of a packet is the same for the segment of data transmitted in the time interval between two evaluations of the signal-to-noise ratio.


Stage 11: Bit Error Rate

The purpose is to obtain the bit error probability based on the SNR value. In order to accurately simulate the bit error rate characteristics of the wireless link, the calculation of BER is not based on the entire data packet, but is calculated based on a small segment in the data packet, because in the data packet During the transmission process, the signal-to-noise ratio is not constant, resulting in BER is not constant.
According to the modulation curve model parameters and the signal-to-noise ratio obtained in the previous transmission stage, plus the channel processing gain to obtain the effective signal-to-noise ratio, and then search the modulation curve to obtain the bit error rate. Because the SNR of each segment of the packet may be different, after finding out the BER for each segment, the total bit error rate is finally obtained by superimposing.


Stage 12: Error distribution

According to the bit error rate of each segment of the data packet obtained in the previous stage, the number of bit errors in each segment of the data packet can be calculated. Then add them up to get the total number of bit errors.
The bit errors of a packet are not simulated for every bit, but only for random selection of the erroneous bits. Calculate the probability of k bit errors according to the bit error rate BER obtained above, and then compare it with a random number between 0 and 1. If it is greater than this random number, assign k bit errors to the packet.
The error distribution calculation formula is as follows.
insert image description here


Stage 13: Error Correction

The result describes the error correction capability of the data packet after collision and background noise interference. According to the frame length, the error correction threshold setting of the receiver and the final number of bit errors, it is determined whether the frame can be accepted. If it is judged that the current data packet can be received, it is allowed to continue to be sent to the upper layer. The judgment at this stage directly affects the packet drop rate and throughput results of the receiving channel.
Considering that the wireless station equipment may be shut down or destroyed in the simulation, there are two criteria for judging whether the data packet can be received, one is whether the source end sends the data packet completely; wrong threshold. If the device is closed or destroyed, the data packet reception will fail; further judge according to the number of error codes and the error correction threshold, if the number of error codes is less than the error correction threshold, the data packet can be received, set the PK_ACCEPT attribute to OPC_TRUE, otherwise destroy the packet. After receiving the package, unlock the signal lock and prepare to accept the next package.


Summarize

The above is all the content of the 14 pipeline stages in OPNET wireless simulation. I hope this article will help you learn OPNET wireless simulation!
Bibliography of this article: OPNET Network Simulation/Edited by Chen Min. - Beijing: Tsinghua University Press, 2004

Guess you like

Origin blog.csdn.net/weixin_42570192/article/details/129682518