m-lab / etl

M-Lab ingestion pipeline
Apache License 2.0
22 stars 7 forks source link

NDT5 control and data connections sometimes have inconsistent IP addresses #1075

Open mattmathis opened 2 years ago

mattmathis commented 2 years ago

For about 10% of the tests NDT5 reports different IP addresses for the data and control connections.

This could either be a server or parser issue. I am putting it in ETL until somebody looks at the raw data. I am aware of one legitimate situation: for a client behind a CGN, the client;s IP address may change to a similar address. In most but not all cases the control connection is reported to be via 127.0.0.1.

To see examples:

# Show NDT5 control and data connections with different IP addresses

SELECT
    raw.control.UUID, raw.C2S.UUID,
    raw.ServerIP,raw.C2S.ServerIP,
    raw.ClientIP,raw.C2S.ClientIP
FROM `mlab-oti.ndt.ndt5`
WHERE date = '2022-03-31'
    AND raw.ServerIP != raw.C2S.ServerIP
LIMIT 100

To see statistics:

# NDT5 control and data connections dont have the same IP addresses

SELECT
    COUNT(*) AS tests,
    COUNTIF(raw.ServerIP != raw.C2S.ServerIP),
    COUNTIF(raw.ServerIP != raw.C2S.ServerIP)/COUNT(*),
    COUNTIF(raw.ServerIP != raw.S2C.ServerIP),
    COUNTIF(raw.ServerIP != raw.S2C.ServerIP)/COUNT(*),
    COUNTIF(raw.ClientIP != raw.C2S.ClientIP),
    COUNTIF(raw.ClientIP != raw.C2S.ClientIP)/COUNT(*),
    COUNTIF(raw.ClientIP != raw.S2C.ClientIP),
    COUNTIF(raw.ClientIP != raw.S2C.ClientIP)/COUNT(*),
FROM `mlab-oti.ndt.ndt5`
WHERE date = '2022-03-31'

(The date is arbitrary, but greatly speeds the queries).

stephen-soltesz commented 2 years ago

I suspect this is an artifact of how the ndt-server implements support for differences between the ndt5 "plain" and "ws" protocols. For WS connections, the ndt-server acts as a proxy to a local server port that has dedicated support for the websocket protocol. https://github.com/m-lab/ndt-server/blob/master/ndt5/plain/plain.go#L64-L72

If you look at CONCAT(raw.Control.Protocol, "-", raw.Control.MessageProtocol) is there a clear pattern?