Skip to content

Commit b94f146

Browse files
committed
first stub for openvpn and tunnel observations
1 parent 011ff9f commit b94f146

3 files changed

Lines changed: 67 additions & 3 deletions

File tree

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ poetry run python -m oonidata mkobs --clickhouse clickhouse://localhost/ --data-
107107
Here is the list of supported observations so far:
108108
* [x] WebObservation, which has information about DNS, TCP, TLS and HTTP(s)
109109
* [x] WebControlObservation, has the control measurements run by web connectivity (is used to generate ground truths)
110-
* [ ] CircumventionToolObservation, still needs to be designed and implemented
111-
(ideally we would use the same for OpenVPN, Psiphon, VanillaTor)
110+
* [ ] TunnelObservation, still needs to be designed and implemented
111+
(ideally we would use the same for OpenVPN, WireGuard, Psiphon, VanillaTor)
112112

113113
### Response body archiving
114114

oonidata/src/oonidata/models/dataformats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ class OpenVPNHandshake(BaseModel):
381381
port: int
382382
transport: str
383383
provider: str
384-
openvpn_options: Optional[dict] = None
384+
openvpn_options: Optional[Dict[str, str]] = None
385385
status: OpenVPNConnectStatus
386386
t0: float
387387
t: float

oonidata/src/oonidata/models/observations.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,3 +397,67 @@ class HTTPMiddleboxObservation(MeasurementMeta):
397397
hfm_diff: Optional[str] = None
398398
hfm_failure: Optional[str] = None
399399
hfm_success: Optional[bool] = None
400+
401+
402+
@add_slots
403+
@dataclass
404+
class OpenVPNHandshakeObservation:
405+
timestamp: datetime
406+
407+
ip: str
408+
port: int
409+
transport: str
410+
411+
success: bool
412+
failure: Failure
413+
414+
protocol: str
415+
variant: Optional[str] = None
416+
417+
# TCP related observation
418+
tcp_failure: Optional[Failure] = None
419+
tcp_success: Optional[bool] = None
420+
tcp_t: Optional[float] = None
421+
422+
# OpenVPN handshake observation
423+
openvpn_handshake_failure: Optional[Failure] = None
424+
openvpn_handshake_success: Optional[bool] = None
425+
openvpn_handshake_t: Optional[float] = None
426+
427+
# timing info about the handshake packets
428+
openvpn_handshake_hr_client_t: Optional[float] = None
429+
openvpn_handshake_hr_server_t: Optional[float] = None
430+
openvpn_handshake_clt_hello_t: Optional[float] = None
431+
openvpn_handshake_srv_hello_t: Optional[float] = None
432+
openvpn_handshake_key_exchg_n: Optional[int] = None
433+
openvpn_handshake_got_keys__t: Optional[float] = None
434+
openvpn_handshake_gen_keys__t: Optional[float] = None
435+
436+
437+
438+
439+
@add_slots
440+
@dataclass
441+
class TunnelEndpointObservation(MeasurementMeta):
442+
__table_name__ = "obs_tunnel"
443+
__table_index__ = ("measurement_uid", "observation_id", "measurement_start_time")
444+
445+
measurement_start_time: datetime
446+
447+
ip: str
448+
port: int
449+
transport: str
450+
451+
# definition of success will need to change when/if we're able to gather metrics
452+
# through the tunnel.
453+
success: bool
454+
failure: Failure
455+
456+
protocol: str
457+
family: str
458+
459+
# indicates obfuscation or modifications from the main protocol family.
460+
variant: Optional[str] = None
461+
462+
# any metadata about the providers behind the endpoints.
463+
provider: Optional[str] = None

0 commit comments

Comments
 (0)