Network Performance Metrics
Network performance is the main measure of the quality of a computer network. This page covers the principal performance metrics — rate, throughput, delay, and the rest — along with the methods used to measure them and the strategies used to improve them.
1. Rate
The rate is the amount of data transmitted per unit of time, usually measured in bits per second (bps).
Classification of Rates
- Bit rate: the number of bits transmitted per second
- Baud rate: the number of signal changes per second
- Data rate: the amount of useful data transmitted per second
Common Rate Units
// Rate unit conversion
typedef enum {
UNIT_BPS = 1,
UNIT_KBPS = 1000,
UNIT_MBPS = 1000000,
UNIT_GBPS = 1000000000
} RateUnit;
// Rate structure
typedef struct {
double value;
RateUnit unit;
char description[128];
} NetworkRate;
// Rate conversion function
double convert_rate(double value, RateUnit from_unit, RateUnit to_unit) {
return value * (double)from_unit / (double)to_unit;
}
// Common network rate examples
NetworkRate common_rates[] = {
{10, UNIT_MBPS, "10Mbps Ethernet"},
{100, UNIT_MBPS, "100Mbps Fast Ethernet"},
{1000, UNIT_MBPS, "1Gbps Gigabit Ethernet"},
{10000, UNIT_MBPS, "10Gbps 10 Gigabit Ethernet"},
{100000, UNIT_MBPS, "100Gbps ultra-high-speed network"}
};
2. Throughput
The throughput is the amount of data that actually crosses the network per unit of time. It reflects the real transmission capacity of the network.
Characteristics of Throughput
- Actual performance: reflects the real transmission capacity of the network
- Dynamic: varies with network load and conditions
- End to end: measures overall performance from source to destination
Throughput Calculation
// Throughput measurement structure
typedef struct {
double bytes_transferred;
double time_elapsed; // seconds
double throughput; // bytes per second
} ThroughputMeasurement;
// Calculate throughput
double calculate_throughput(double bytes, double time) {
if (time <= 0) return 0;
return bytes / time;
}
// Throughput test function
ThroughputMeasurement measure_throughput(double start_time, double end_time,
double total_bytes) {
ThroughputMeasurement result;
result.bytes_transferred = total_bytes;
result.time_elapsed = end_time - start_time;
result.throughput = calculate_throughput(total_bytes, result.time_elapsed);
return result;
}
3. Delay
The delay is the time data needs to travel from the source to the destination. It is a key indicator of network performance.
Components of Delay
1. Transmission Delay
- Definition: the time required for data to move from the sending end to the receiving end
- Formula: transmission delay = data length / transmission rate
- Factors: data size, transmission rate
2. Propagation Delay
- Definition: the time a signal takes to propagate through the transmission medium
- Formula: propagation delay = distance / propagation speed
- Factors: transmission distance, medium type
3. Processing Delay
- Definition: the time a router or switch spends processing a packet
- Factors: device performance, queue length
4. Queuing Delay
- Definition: the time a packet waits in a router queue
- Factors: network congestion, queue length
Delay Calculation Example
// Delay structure
typedef struct {
double transmission_delay; // transmission delay
double propagation_delay; // propagation delay
double processing_delay; // processing delay
double queuing_delay; // queuing delay
double total_delay; // total delay
} NetworkDelay;
// Calculate total delay
double calculate_total_delay(NetworkDelay *delay) {
delay->total_delay = delay->transmission_delay +
delay->propagation_delay +
delay->processing_delay +
delay->queuing_delay;
return delay->total_delay;
}
// Transmission delay calculation
double calculate_transmission_delay(int data_size, double rate) {
return (double)data_size / rate;
}
// Propagation delay calculation
double calculate_propagation_delay(double distance, double speed) {
return distance / speed;
}
4. Delay-Bandwidth Product
The delay-bandwidth product is the product of the propagation delay and the bandwidth. It represents the amount of data that can be in the network at any one time.
Meaning of the Delay-Bandwidth Product
- Network capacity: reflects the transmission capacity of the network
- Buffer size: guides buffer sizing
- Performance tuning: helps optimise network performance
// Delay-bandwidth product calculation
double calculate_delay_bandwidth_product(double delay, double bandwidth) {
return delay * bandwidth;
}
// Network pipe capacity
typedef struct {
double delay; // Propagation delay (seconds)
double bandwidth; // Bandwidth (bps)
double product; // Delay-bandwidth product (bits)
double buffer_size; // Recommended buffer size
} NetworkPipe;
5. Utilisation
The utilisation is the ratio between the amount a network actually carries and its capacity.
Utilisation Calculation
// Utilisation calculation
double calculate_utilization(double actual_throughput, double capacity) {
if (capacity <= 0) return 0;
return (actual_throughput / capacity) * 100.0;
}
// Network utilisation monitoring
typedef struct {
double current_throughput;
double max_capacity;
double utilization_percentage;
time_t timestamp;
} UtilizationMonitor;
// Update utilisation
void update_utilization(UtilizationMonitor *monitor, double throughput) {
monitor->current_throughput = throughput;
monitor->utilization_percentage = calculate_utilization(throughput, monitor->max_capacity);
monitor->timestamp = time(NULL);
}
6. Packet Loss Rate
The packet loss rate is the percentage of packets that are lost relative to all packets sent.
Packet Loss Rate Calculation
// Packet loss rate calculation
double calculate_packet_loss_rate(int sent_packets, int received_packets) {
if (sent_packets <= 0) return 0;
return ((double)(sent_packets - received_packets) / sent_packets) * 100.0;
}
// Packet loss statistics
typedef struct {
int total_sent;
int total_received;
int total_lost;
double loss_rate;
} PacketLossStats;
// Update packet loss statistics
void update_packet_loss_stats(PacketLossStats *stats, int sent, int received) {
stats->total_sent += sent;
stats->total_received += received;
stats->total_lost = stats->total_sent - stats->total_received;
stats->loss_rate = calculate_packet_loss_rate(stats->total_sent, stats->total_received);
}
7. Bit Error Rate
The bit error rate is the percentage of bits that are corrupted during transmission relative to all bits transmitted.
Bit Error Rate Calculation
// Bit error rate calculation
double calculate_bit_error_rate(int total_bits, int error_bits) {
if (total_bits <= 0) return 0;
return ((double)error_bits / total_bits) * 100.0;
}
// Bit error detection
typedef struct {
int total_bits;
int error_bits;
double error_rate;
char error_pattern[256];
} BitErrorStats;
1. Active Measurement
Ping Test
// Ping test structure
typedef struct {
char target_host[256];
int packet_size;
int count;
double min_rtt;
double max_rtt;
double avg_rtt;
double packet_loss;
} PingTest;
// Run a ping test
PingTest execute_ping_test(const char *host, int size, int count) {
PingTest test;
strcpy(test.target_host, host);
test.packet_size = size;
test.count = count;
// Simulated ping test results
test.min_rtt = 10.0; // milliseconds
test.max_rtt = 50.0;
test.avg_rtt = 25.0;
test.packet_loss = 0.1; // 0.1%
return test;
}
Throughput Test
// Throughput test
typedef struct {
char server[256];
int port;
double duration; // Test duration (seconds)
double throughput; // Test result (Mbps)
} ThroughputTest;
// Run a throughput test
ThroughputTest execute_throughput_test(const char *server, int port, double duration) {
ThroughputTest test;
strcpy(test.server, server);
test.port = port;
test.duration = duration;
// Simulated test result
test.throughput = 95.5; // Mbps
return test;
}
2. Passive Measurement
Network Monitoring
// Network monitoring structure
typedef struct {
time_t timestamp;
double bandwidth_usage;
double packet_rate;
double error_rate;
int active_connections;
} NetworkMonitor;
// Collect network monitoring data
NetworkMonitor collect_network_stats() {
NetworkMonitor monitor;
monitor.timestamp = time(NULL);
monitor.bandwidth_usage = 75.5; // percentage
monitor.packet_rate = 10000; // packets/second
monitor.error_rate = 0.01; // percentage
monitor.active_connections = 150;
return monitor;
}
1. Bandwidth Optimisation
- Traffic shaping: control the rate at which data flows
- QoS policies: give important traffic priority
- Load balancing: spread the network load
2. Delay Optimisation
- Routing optimisation: choose the best path
- Caching strategies: avoid transmitting the same data twice
- Protocol optimisation: use efficient protocols
3. Reliability Optimisation
- Redundancy: back up critical links
- Error detection: find and correct errors promptly
- Fault recovery: restore service quickly
| Term | Abbreviation | Explanation |
|---|---|---|
| Bandwidth | - | Maximum data rate of a channel |
| Throughput | - | Actual data transmission rate |
| Delay / Latency | - | Total time spent transmitting data |
| Transmission Delay | - | Time required to send the data |
| Propagation Delay | - | Time taken by the signal to propagate |
| Processing Delay | - | Time a router spends processing a packet |
| Queuing Delay | - | Time a packet waits in a router queue |
| Round-Trip Time | RTT | Time from sending a packet to receiving its acknowledgement |
| Delay-Bandwidth Product | - | Measure of the capacity of a link |
| Packet Loss Rate | - | Proportion of packets that are lost |
| Utilisation | - | Proportion of resources in use |
| Bit Error Rate | BER | Proportion of bits that are corrupted |
| Availability | - | Proportion of time the system runs normally |
| Reliability | - | Ability to run without failure |
| Quality of Service | QoS | Performance guarantees for a network service |
| Peak Rate | - | Maximum instantaneous data rate |
| Average Rate | - | Average data transmission rate |
