AVB Tutorial
Tutorial Goals
This tutorial is an introduction to
using VisualSim AVB library. You will construct a basic system with
three talkers and a listener connected over a bridge. The following is
a summary of the concepts and tasks you will learn in this tutorial.
- Instantiate VisualSim AVB Nodes, Bridge, AVB Stats, AVB SRP and AVB Traffic generation.
- Configuration of AVB Config Tables and AVB Network Setup
- Run simulations to analyze the latency for all streams and network statistics.
Target
Purpose of this tutorial is to build a
performance model that identifies AVB network bandwidth, bottlenecks,
latency and network activity. The block diagram of the proposed system
is shown in figure 1.0
Figure 1.0
Open this model in VisualSim from the following location:
File->Open File
$VS/doc/Training_Material/Tutorial/WebHelp/Tutorial/Networking/AVB_Example_Model.xml
Basic Rules
- All Sources and Destination must start with Node_ followed by a number
- All Bridges must start with Bridge_ followed by a number
- Each Traffic Generator will have a Traffic Table
- Bandwidth credit and Class type for all streams from all nodes are listed in a single Stream Table
- The AVB_Network_Setup must be present in all models using AVB.
- The AVB_Config_Table is only an example of the required
Tables. The user must modify all the Tables to setup the required
configuration. Additional Traffic Tables must be added to cover
all the Nodes.
Construction Steps
To construct an AVB network model, there are five parts
- AVB confiuration tables
- Pre-process block called AVB_Network_Setup
- Instantiate Nodes and Bridges
- Add the traffic and the Stream Reservation Protocol module for each Node.
- Attach the statistics block to each of the Nodes that are receiving data
Step 1:
- Drag
Application->Networking->AVB->AVB_Config_Table block into the
Block Diagram Editor. This provides the list of sample Tables
that are required for the AVB model.
- The parameter-
Routing_Table_Name value will be common to all the Node, Bridge,
AVB_Network_Setup and to this block. Link this to the top-level
Routing_Table_Name
- Right-click on the block and select Open Block’ menu item parameter.
- There are eight common tables
- Routing_Table-
No change. This is a standard block in the
Application->Networking library. This is required to handle the
routing between nodes, compute the latency on the links and maintain
statistics.
- Buffer_ClkSync-
No change. Buffer_ClkSync is a Memory_Init block. This contains a
set of required parameters for AVB. The following is the list of
variables.
Percent_BW global 0.75 ; ---Maximum allocation to Class A or B of the total bandwidth for that Type
Max_Pkt_Bytes
global 1500 ; ---Maximum packet size Max_Buffer_Pkts global 256 Maximum
number of buffers at each Node. Each buffer can hold one Data Structure
or packet
Grand_Master global "Node_1" ; ---Node Name of the
Master for the Clock Sync. Grand_Master_Rate global 200.0E-03 ;
---Rate of Clock Synchronization messages from the Grand Master
Node
- Multicast_List-
No change. Multicast_List is a Memory_Init block. This block
contains all the information required for the Ethernet MAC ID Multicast
IGMP protocol.
The first row in this block has the name
Multicast_List Global {List of Multicast} ;. The remaining rows contain
the Destination Nodes list for each item in the Multicast list in Row
1. For each Row, the format will be ListName global {Node1, Node2} ;.
The ListName must be Multicast_+Number. The number must be an
increasing sequence and no number must be left out.
- Link_Setup-
This table contains the attributes of each link in the network.
This table is common to both AVB and non-AVB networks. The
Linking_Table_Name of this block must match the name of the
Routing_Table block. For each link in the model, define all the
links with Source, Destination, Distance, Speed and Duplex (true).
ID
Source_Node Destination_Node
Distance
Speed_Mbps Duplex ;
1
Node_1
Bridge_4
1.0
100.0 true ;
2 Node_2
Bridge_4
1.0
100.0 true ;
3 Node_3
Bridge_4
1.0
100.0 true ;
4 Bridge_4
Node_5
1.0
100.0 true ;
Field Definitions:
ID; Increasing sequence number starting from 1.
Source_Node: Starting Node
Destination_Node: Ending Node of this link
Distance: Length of the link. The unit is defined by the Routing_Latency parameter of the Routing_Table block.
Speed_Mbps: Bandwidth of this link.
Duplex: This is an optional field. If true, then links in both directions with the same distance and speed.
- Traffic_Table-
One table is required for each Node. Enter the list of both AVB
and Ethernet streams. One sample table is provided. Copy
this instance to generate the required number of traffic tables. Make
sure to give each Table a unique Name for the Linking_Table_Name.
Instantiate additional two Traffic _Table and provide names as Traffic2
and Traffic3 by entering the values for the parameter
Linking_Table_Name. The list of all theTraffic_Tables must be provided
to the AVB_Network_Setup block.
ID Identifier Task_Source Task_Destination Mbps Task_Size Start_Time Stop_Time Protocol Type ;
1
"00:01" Node_1
Node_5
2.0 128
10.0E-03
15.0 UDP 1 ;
2
"00:02"
Node_1
Node_5
2.0
512
10.0E-03
0.5 UDP
1 ;
3 "00:03"
Node_1
Node_5
5.0
1024
10.0E-03
0.5
UDP 1 ;
4 "00:04"
Node_1
Node_5
3.0
64
10.0E-03
0.5 UDP
1 ;
ID: Increasing sequence number
Identifier: For Ethernet traffic, this field will be "Ethernet". For AVB streams, this will be any other value.
Task_Source: Name of this Source Node.
Task_Destination: Name of the final destination or listener.
Mbps: Generation rate of this traffic stream
Task_Size: Packet data size. Does not include headers or tailers
Start_Time: Time in seconds after the start of the simulation
Stop_Time: Time in seconds after the start of the simulation
Protocol: UDP or TCP
Type: Type of Class. Can be 0 to 7.
-
Stream- This table contains the Class and the requested bandwidth for all AVB stream from all the nodes.
ID
Mac_ID
Identifier
SR_Class
Mbps ;
1
"a0:36:9f:0c:77:38"
"00:01"
A
2.0 ;
2
"a0:36:9f:0c:77:38"
"00:02"
A
2.0 ;
3
"a0:36:9f:0c:77:38"
"00:03"
B
5.0 ;
4
"a0:36:9f:0c:77:38"
"00:04"
A
3.0 ;
5
"a0:36:9f:0c:77:39"
"00:05"
A
2.0 ;
6
"a0:36:9f:0c:77:39"
"00:06"
A
2.0 ;
7
"a0:36:9f:0c:77:39"
"00:07"
B
5.0 ;
8
"a0:36:9f:0c:77:39"
"00:08"
A
3.0 ;
9
"a0:36:9f:0c:77:3A"
"00:09"
A
2.0 ;
10
"a0:36:9f:0c:77:3A"
"00:10"
A
2.0 ;
11
"a0:36:9f:0c:77:3A"
"00:11"
B
5.0 ;
12
"a0:36:9f:0c:77:3A"
"00:12"
A
3.0 ;
ID: Increaing sequence number
MAC_ID: Physical address of the Node
Identifier: Unique ID for each AVB stream. This must match the Identifier in the Traffic Table.
SR_Class: Stream Reservation class of this AVB stream- A or B.
Mbps: Requested bandwidth
- Type_to_BW-
For each Bridge and Node in the model, the amount of bandwidth
allocated to each Type is specified in this Table. This table has two
formats. It can have a single common column with the title Mbps or a
separate column for each Node and Bridge in the model.
Common format is:
ID Type Mbps ;
0
0
25.0 ;
1
1
0.0 ;
2
2
0.0 ;
3
3
40.0 ;
4
4
0.0 ;
5
5
25.0 ;
6
6
0.0 ;
7
7
0.0 ;
ID: Increasing sequence number starting from 1.
Type: Type of Class. The values are 0 to 7.
Mbps: Bandwidth allocation. The sum of all the rows of this column must not exceed the total bandwidth of the links.
Full-format is:
ID
Type Node_1 Node_2
Node_3
Bridge_4
Node_5 ;
0
0
25.0
25.0
25.0
25.0
25.0 ;
1
1
0.0
0.0
0.0
0.0
10.0 ;
2
2
0.0
0.0
0.0
0.0
0.0 ;
3
3
40.0
40.0
40.0
40.0
40.0 ;
4
4
0.0
0.0
0.0
0.0
0.0 ;
5
5
25.0
25.0
25.0
20.0
25.0 ;
6
6
0.0
0.0
0.0
0.0
0.0 ;
7
7
0.0
0.0
0.0
0.0
0.0 ;
ID: Increasing sequence number starting from 1.
Type: Type of Class. The values are 0 to 7.
Node_1, Bridge_1...: Bandwidth
allocation. The sum of all the rows of each column must not exceed the
total bandwidth of the link.
- Class_to_Type- For each Bridge and Node in the model, the mapping of Type to Class and B. This Table also has two formats.
Common Format:
ID Class Type ;
0
A 5
;
1
B 3
;
ID: Increasing sequence number starting from 1
Class: A or B
Type: Type of Class. The values are 0 to 7. Common to all Nodes and Bridges in the model.
Full-Format:
ID
Class
Node_1 Node_2
Node_3
Bridge_4
Node_5 ;
0
A 5
5
5
5
5
;
1
B 3
3
3
3
3
;
ID: Increasing sequence number starting from 1.
Class: First Row is A and the second row is B.
Node_1, Bridge_1...: Type for Class A and B.
Step 2:
In this step we add the
block required for Pre-processing the tables. This block must be
added to all AVB models or models that use the AVB blocks. This
block does require the existence of the Traffic tables, Routing Table,
Link Setup table, Type_to_BW table, Class_to_Type table and Multicast
Memory_Init block.
- Instantiate the Application->Networking->AVB->AVB_Setup block.
- Link the Routing_Table_Name parameter to the top-level. This ensures that all blocks will use the same name.
- In the
parameter ‘List_of_Tables’, list all the traffic tables names as
strings in array. For Example, if you have three Traffic_Generator, you
will need three trafic tables in "AVB_Config_Tables". List all three
traffic table names for the parameter "Traffic_Tables" as
{"Traffic","Traffic2","Traffic3"} in AVB_Network_Setup.
Step 3:
1. Add three AVB_Node blocks from the
library pane Application->Networking->AVB->AVB_Node as
specified in the Link_Configuration table. Assign unique name for each
AVB_Nodes, for example Node_1, Node_2, Node_3 and Node_5 (destination
node. The rule here is that the name must be Node_ followed by a
number. No two Nodes can have the same.
2. Link the Routing_Table_Name with the parameter at the top-level.
3. Each Source Node block will be
connected an Application->Networking->Network_Traffic_Generator
(Ethernet_Traffic) block connected to a
Application->Networking->AVB->AVB_SRP which is connected
to the Application->networking->AVB->AVB_Node Block
AVB_Node block. Instantiate three Network_Traffic_Generator
(Ethernet_Traffic) blocks, three AVB_SRP blocks and provide unique
names The AVB_Stats block will only be attached to a Destination block
(AVB Node_5). A Destination-only block will have the AVB_Stats
block attached to the Node block output. A Node that is both
Source and Destination will have the AVB_Stats connected to the
data_out port of the Ethernet_Traffic block. Make the connections as
shown in figure 2.0
4. The Bridge connects the Nodes to the network and also connects to
other Bridges. The bridge block handles the Routing, broadcast of
clock synchronization, AVB stream reservation and traffic
shaping. A maximum of 8 links can be connected to a Bridge
block. These can be any combination of Bridges and Nodes.
Instatiate AVB_Bridge from the library pane Application->Networking->AVB->AVB_Bridge.
Assign a unique name to each Bridge block. The rule here is that
the name must be Bridge_ followed by a number. No two Bridges can
have the same. Set Bridge name as Bridge4 for this example. For
the parameter, add the Routing_Table_Name. For now it is just
“RT".
Figure 2.0
Step 4:
Instantiate AVB_Stats block from the
library pane Application->Networking->AVB->AVB_Stats and make
connections as shown in figure 2.0. The AVB_Stats block can be
connected directly to the Node out for a Destination-only or the
data_out port of the Ethernet_Traffic block for a Source+Destination
block.
The AVB_Stats generates 4 different pieces of information. They are:
- The latency statistics for all the streams arriving at Node to which this AVB_Stats is connected.
Ethernet Stream N1_to_N4_Ether_1 Minimum: 56.32400 us Mean: 334.29015 us Std Dev: 100.22922 us Maximum: 1.25056400 ms
|
AVB Stream N2_to_N4_Stream_7 Minimum: 1.08576400 ms Mean: 1.08576400 ms Std Dev: 0.00 ns Maximum: 1.08576400 m
|
Here,
N1_to_N4- Node_1 to Node_4
Ether_1- Ethernet stream with ID 1 in the Traffic Table
Stream_7- 07 is the Stream Identifier in the stream table and the Traffic Table
Minimum- Lowest latency recorded during the simulation
Maximum- Highest latency recorded during the simulation
Mean- Average of all the latencies recorded
Std Dev- Standard Deviation of the latencies
- The activity during the simulation
including the Talker Advertise, Listener Ready, Talker Failed,
Deregister, Stream Reservation protocol loop activity and data transfer
rate.
Stream 00:05 at Node 2 issues Talker Advertise message to the Node.
DISPLAY AT TIME ------ 10.00000010 ms ------ Node_2 issue Task_Message Talker Advertise with Register for 00:05 Stream 00:07 of type Class B failed to get bandwidth credit at Bridge_2 with failure Code 3 DISPLAY AT TIME ------ 10.63360210 ms ------ WARNING: Bridge_2 Class B does not match Type: 3 with Fail Code 3 for 00:07 Stream 00:05 of Node_2 of type class A received a Listener ready and will start transmitting. DISPLAY AT TIME ------ 11.24384410 ms ------ Node_2 Stream Reservation Listener Ready, start Traffic for Class A Stream: 00:05 Stream 00:08 of Node_2 has stopped transmitting. DISPLAY AT TIME ------ 500.09215670 ms ------ Node_2 end Traffic for Identifier: 00:08 Stream 00:08 of Node_2 has deregisted on the Network. DISPLAY AT TIME ------ 500.09215670 ms ------ WARNING: Node_2 De-Register Class A for 00:08
|
- Graphical plot showing the Latency for all the streams arriving at the Node to which this AVB_Stats block is connected.
Figure 3.0: Stream Latency Plot
- Histogram of the Latency for all the streams arriving at the Node to which this AVB_Stats block is connected.
Figure 4.0: Histogram of the Stream Latencies
AVB Stats will capture all
the statistics including the activity traces, latency and histogram
plots. You can see a unique latency graph at each Listener of
Destination Node. We only need this block for Nodes that will receive
data.
Step 5:
Now the model has been constructed. The
next step is to run the simulation. Each simulation run can have
different setup values- such as Network Toplogy (Link_Setup file),
traffic streams from each node (Traffic table), number of AVB streams
(stream table) and allocation of bandwidth to each Type at each Bridge
(Type_to_BW).
For each run, the statistics
are provided in a combination of files and graphical plots. View
Step 4 to see the list of plots and reports.