Network Diagnostics

Network testing, performance measurement, and connectivity analysis

Introduction

The Network Diagnostics system provides comprehensive tools for testing, measuring, and analyzing network connectivity, performance, and routing paths. It enables automated validation of network infrastructure, identification of bottlenecks, measurement of bandwidth capabilities, and troubleshooting of connectivity issues.

Core Capabilities

Architecture Components

ComponentPurposeMetrics
FW_Audit_PingICMP echo request/reply testingRTT, packet loss, jitter, std dev
FW_Audit_TracerouteNetwork path analysisHops, per-hop RTT, geo location
FW_Audit_SpeedTestBandwidth measurementDownload/upload Mbps, quality score
FW_NetworkDetailsNetwork enrichment dataGeoIP, ISP, ASN, coordinates

Ping Testing

Ping ? uses ICMP echo requests to verify network connectivity, measure round-trip time, and detect packet loss.

Using FW_Audit_Ping

// Direct API Usage
FW_Audit_Ping ping = FW_AuditManager.INSTANCE.getAuditPing();
Object result = ping.runAuditPing(
    "www.example.com",  // target host
    10,                  // ping count
    2,                   // timeout (seconds)
    true                 // verbose output
);

// Test Suite Usage
@Test
@Tag("network")
@DisplayName("TC - Ping - Google DNS")
public void tc_ping_google_dns() {
    FW_CustomAssertJU.autoPass(
        FW_AuditManager.INSTANCE.getAuditPing()
            .runAuditPing("8.8.8.8", 5, 2, true)
    );
}

Ping Thresholds

MetricExcellentGoodFairPoor
RTT (Round-Trip Time)<50ms50-100ms100-200ms>200ms
Packet Loss0%<1%1-5%>5%
Jitter<5ms5-20ms20-50ms>50ms

Traceroute Analysis

Traceroute ? displays the network path packets take from source to destination, showing each "hop" along the way with timing and location data.

Using FW_Audit_Traceroute

// Direct API Usage
FW_Audit_Traceroute traceroute = FW_AuditManager.INSTANCE.getAuditTraceroute();
Object result = traceroute.runAuditTraceroute(
    "www.example.com",  // target host
    120,                 // max duration (seconds)
    30,                  // max hops
    true                 // verbose output
);

// Test Suite Usage
@Test
@Tag("network")
@DisplayName("TC - Traceroute - Production Server")
public void tc_traceroute_production() {
    FW_CustomAssertJU.autoPass(
        FW_AuditManager.INSTANCE.getAuditTraceroute()
            .runAuditTraceroute("www.saucedemo.com", 120, 30, true)
    );
}

Speed Testing

Bandwidth measurement for download/upload throughput with quality scoring.

Using FW_Audit_SpeedTest

// Direct API Usage
FW_Audit_SpeedTest speedTest = FW_AuditManager.INSTANCE.getAuditSpeedTest();
Object result = speedTest.runAuditSpeedTest(true); // verbose

// Test Suite Usage
@Test
@Tag("network")
@DisplayName("TC - Speed Test - Network Bandwidth")
public void tc_speedtest_bandwidth() {
    FW_CustomAssertJU.autoPass(
        FW_AuditManager.INSTANCE.getAuditSpeedTest()
            .runAuditSpeedTest(true)
    );
}

Speed Thresholds

MetricVery PoorFairGoodExcellent
Download Speed<1 Mbps10-50 Mbps50-100 Mbps>100 Mbps
Quality Score0-1940-5960-7980-100

TS_Network_JUnit Test Suite

public class TS_Network_JUnit {
    
    @Test
    @Tag("network")
    @DisplayName("TC - Traceroute - SauceDemo")
    public void tc_traceroute_saucedemo() {
        FW_CustomAssertJU.autoPass(
            FW_AuditManager.INSTANCE.getAuditTraceroute()
                .runAuditTraceroute("www.saucedemo.com", 120, 30, true)
        );
    }
    
    @Test
    @Tag("network")
    @DisplayName("TC - Ping - Google DNS")
    public void tc_ping_google() {
        FW_CustomAssertJU.autoPass(
            FW_AuditManager.INSTANCE.getAuditPing()
                .runAuditPing("google.com", 4, 2, true)
        );
    }
    
    @Test
    @Tag("network")
    @DisplayName("TC - Speed Test")
    public void tc_speedtest() {
        FW_CustomAssertJU.autoPass(
            FW_AuditManager.INSTANCE.getAuditSpeedTest()
                .runAuditSpeedTest(true)
        );
    }
}

Running the Test Suite

# Run all network tests
mvn test -Dtest=TS_Network_JUnit

# Run specific test
mvn test -Dtest=TS_Network_JUnit#tc_ping_google

# Run with tags
mvn test -Dgroups="network"

Configuration Options

# testConfig.properties

# Ping Configuration
network.ping.defaultCount=5
network.ping.defaultTimeout=2
network.ping.maxJitter=50

# Traceroute Configuration
network.traceroute.maxDuration=120
network.traceroute.maxHops=30

# Speed Test Configuration
network.speedtest.duration=15
network.speedtest.uploadDuration=10

# GeoIP Configuration
network.geoip.enabled=true
network.geoip.provider=ip-api.com

Troubleshooting

⚠️ Host unreachable

Cause: Target offline, firewall, DNS failure. Solution: Verify host is online, check firewall rules.

⚠️ High packet loss

Cause: Network congestion, routing issues. Solution: Test wired connection, try different times.

⚠️ Traceroute timeout

Cause: ICMP blocked by router. Solution: Expected for some hops - routers may block ICMP.

⚠️ Speed test fails

Cause: Firewall, insufficient bandwidth. Solution: Check firewall rules, retry later.

Best Practices

For Test Writers

For DevOps

DocumentDescription
HTTP Security AssessmentHTTP audit tools
Test Development GuideWriting tests
Test Execution GuideRunning tests
Architecture DiagramLayer 6 details