By looking at a obfs4 bridge, we can see that it ends with iat-mode=x which x can be 0, 1 or 2.

Bridge obfs4 0F2C3218 cert=FH+9dukjekdfhcn iat-mode=0

What does this iat-mode indicates about a bridge?


see https://github.com/Yawning/obfs4/blob/obfs4proxy-0.0.9/transports/obfs4/obfs4.go#L521

if conn.iatMode != iatNone {
    var iatFrame [framing.MaximumSegmentLength]byte
    for frameBuf.Len() > 0 {
        iatWrLen := 0

        switch conn.iatMode {
        case iatEnabled:
            // Standard (ScrambleSuit-style) IAT obfuscation optimizes for
            // bulk transport and will write ~MTU sized frames when
            // possible.
            iatWrLen, err = frameBuf.Read(iatFrame[:])

        case iatParanoid:
            // Paranoid IAT obfuscation throws performance out of the
            // window and will sample the length distribution every time a
            // write is scheduled.
            targetLen := conn.lenDist.Sample()
            if frameBuf.Len() < targetLen {
                // There's not enough data buffered for the target write,
                // so padding must be inserted.
                if err = conn.padBurst(&frameBuf, targetLen); err != nil {
                    return 0, err
                if frameBuf.Len() != targetLen {
                    // Ugh, padding came out to a value that required more
                    // than one frame, this is relatively unlikely so just
                    // resample since there's enough data to ensure that
                    // the next sample will be written.
            iatWrLen, err = frameBuf.Read(iatFrame[:targetLen])
  • 1
    Could you please describe what that part of the source code does? I guess not everyone is familiar with reading code and could benefit from an explanation. – Jens Kubieziel Apr 10 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.