What is IMIX traffic?
IMIX (Internet Mix) is a standardized traffic pattern that simulates real-world internet traffic in a test environment. It consists of packets of different sizes mixed in specific proportions to represent typical internet traffic.
The concept emerged from studying actual internet traffic patterns and creating a simplified model that could be used for testing network devices and applications.
Why is IMIX traffic important?
Network testing with fixed-size packets doesn’t reflect real-world conditions. Here’s why IMIX matters:
- Real-world simulation: Internet traffic consists of various packet sizes - from small TCP ACKs to large data transfers
- Better performance metrics: Testing with IMIX provides more accurate throughput and latency measurements
- Device stress testing: Different packet sizes stress different components of network devices
- Network planning: IMIX helps in capacity planning and network design decisions
IMIX traffic profiles
While IMIX is widely used in the networking industry, it’s important to note that it’s a de-facto standard, not a de-jure one. This means it evolved through common usage rather than formal standardization.
Standard IMIX
The most common IMIX profile uses a 7:4:1 packet ratio. In Ostinato, we use -
Packet Size | No of Packets | Percentage |
---|---|---|
64 | 7 | 58.33% |
594 | 4 | 33.33% |
1518 | 1 | 8.33% |
While this packet ratio (7:4:1) is commonly used across the industry, there can be variations in the packet sizes and load distribution among different vendors.
These variations in packet sizes don’t significantly impact test results as long as you
- Document which profile you’re using
- Use the same profile consistently across your tests
- Account for the differences when comparing results across different tools
You can create your own profile also if that better suits your needs.
IMIX Genome
The IMIX genome concept, introduced in RFC 6985, provides a standardized way to specify the exact repeating sequence of packet sizes in a test. The genome notation uses letters to represent standard packet sizes.
Size (Bytes) | Genome Code Letter |
---|---|
64 | a |
128 | b |
256 | c |
512 | d |
1024 | e |
1280 | f |
1518 | g |
2112 | h |
9000 | i |
16000 | j |
MTU | z |
For example, a sequence of three 64-byte packets followed by two 1280-byte packets and one 1518-byte packet would be written as
IMIX - aaaffg
This notation ensures test conditions can be precisely documented and reproduced.
Generating IMIX with Ostinato
Generating standard IMIX
Ostinato makes it incredibly easy to generate standard IMIX traffic
- Create a new stream
- In the Frame Length section, simply select IMIX from the dropdown
- Under Stream Control section, set the stream to Goto first
- Configure other stream parameters as needed
- Start transmission
Generating other IMIX profiles
For custom IMIX profiles, follow these steps
- Set the port Transmit Mode to Interleaved
- Create a stream for the first packet size
- Set the appropriate frame length for the stream
- Configure packet rate to the number of packets of that size per second
- Configure other stream parameters as needed
- Duplicate the stream for other packet sizes in the profile
- Edit the duplicated streams to change the frame length and packet rate appropriately
After configuring all the streams, you will notice that the port’s aggregate packet rate is the sum of all the stream packet rates - which would be very low.
You can change it to the desired rate by changing the port’s aggregate packet rate - the packet ratio for the streams will still be maintained. Do not change the individual stream packet rates - only the port’s aggregate packet rate!
For IMIX - aaaffg
, here’s the stream configuration that you should configure -
Stream | Frame Length | Packet Rate |
---|---|---|
1 | 64 | 3 packets/sec |
2 | 1280 | 2 packets/sec |
3 | 1518 | 1 packets/sec |
After configuring the streams to the above mentioned values, the port’s aggregate packet rate will display 6.000 pps
(3+2+1). You can change it to any other value – the packet ratio for the streams will still be maintained. Do not change the individual stream packet rates - only the port’s aggregate packet rate!
How to verify IMIX?
To verify your IMIX traffic pattern:
- Capture traffic using Wireshark or similar tools
- Use Wireshark Statistics > Packet Lengths
- Compare the distribution with your intended IMIX profile
- Look for any anomalies in the distribution
Notice that the packet lengths shown in Wireshark statistics are for ranges of packet sizes and not the exact packet sizes.
If you need to verify the exact packet sizes, you can use the following bash script - the script usestshark
and bc
.
Also, packet captures by Wireshark and other tools typically don’t include the 4-byte FCS (Frame Check Sequence) in the packet length. So the script adjusts the packet length by subtracting 4 from the packet length.
#!/bin/bash
# Usage: ./imix_count.sh capture.pcap
# Bash script to count packets by size (adjusted for FCS) and compute percentages
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <pcap_file>"
exit 1
fi
# Uncomment to debug
#set -x
PCAP_FILE="$1"
SIZES=(64 594 1518)
declare -A COUNTS
TOTAL=0
TSHARK=tshark
# First pass: count packets per size (adjusted for FCS)
for SIZE in "${SIZES[@]}"; do
ADJ_SIZE=$((SIZE - 4)) # Adjust for FCS
COUNT=$($TSHARK -r "$PCAP_FILE" -Y "frame.len == $ADJ_SIZE" | wc -l)
COUNTS[$SIZE]=$COUNT
TOTAL=$((TOTAL + COUNT))
done
echo ""
if [[ $TOTAL -eq 0 ]]; then
echo "No matching packets found."
exit 0
fi
# Output: count and percentage on same line
printf "%8s %10s %8s\n" "Size(B)" "Count" "Percentage"
echo "------------------------------------"
for SIZE in "${SIZES[@]}"; do
COUNT=${COUNTS[$SIZE]}
PCT=$(echo "scale=2; 100 * $COUNT / $TOTAL" | bc)
printf "%8s %10s %8s%%\n" "$SIZE" "$COUNT" "$PCT"
done
Change the SIZES
array to the packet sizes you want to verify.
Here’s a sample output -
$ ./imix-count.sh imix-capture.pcap
Size(B) Count Percentage
------------------------------------
64 6923 58.33%
594 3956 33.33%
1518 989 8.33%
Remember to capture a significant number of packets to get statistically meaningful results!