Documentation ¶
Index ¶
- Constants
- func Check(e error)
- func ChoosePath(interactive bool, pathAlgo string, local snet.Addr, remote snet.Addr) *sciond.PathReplyEntry
- func EncodeBwtestParameters(bwtp *BwtestParameters, buf []byte) int
- func EncodeBwtestResult(res *BwtestResult, buf []byte) int
- func HandleDCConnReceive(bwp *BwtestParameters, udpConnection *snet.Conn, res *BwtestResult, ...)
- func HandleDCConnSend(bwp *BwtestParameters, udpConnection *snet.Conn)
- func LogFatal(msg string, a ...interface{})
- func LogPanicAndRestart(f func(a *snet.Conn, b string, c []byte, d []byte), CCConn *snet.Conn, ...)
- func PrgFill(key []byte, iv int, data []byte)
- type BwtestParameters
- type BwtestResult
Constants ¶
View Source
const ( // Maximum duration of a bandwidth test MaxDuration time.Duration = time.Second * 10 // Maximum amount of time to wait for straggler packets StragglerWaitPeriod time.Duration = time.Second // Allow sending beyond the finish time by this amount GracePeriodSend time.Duration = time.Millisecond * 10 // Min packet size is 4 bytes, so that 32-bit integer fits in // Ideally packet size > 4 bytes, so that part of the PRG is also in packet MinPacketSize int64 = 4 // Max packet size to avoid allocation of too large a buffer, make it large enough for jumbo frames++ MaxPacketSize int64 = 66000 // Make sure the port number is a port the server application can connect to MinPort uint16 = 1024 MaxTries int64 = 5 // Number of times to try to reach server Timeout time.Duration = time.Millisecond * 500 MaxRTT time.Duration = time.Millisecond * 1000 )
Variables ¶
This section is empty.
Functions ¶
func ChoosePath ¶
func EncodeBwtestParameters ¶
func EncodeBwtestParameters(bwtp *BwtestParameters, buf []byte) int
Encode BwtestParameters into a sufficiently large byte buffer that is passed in, return the number of bytes written
func EncodeBwtestResult ¶
func EncodeBwtestResult(res *BwtestResult, buf []byte) int
Encode BwtestResult into a sufficiently large byte buffer that is passed in, return the number of bytes written
func HandleDCConnReceive ¶
func HandleDCConnReceive(bwp *BwtestParameters, udpConnection *snet.Conn, res *BwtestResult, resLock *sync.Mutex, done *sync.Mutex)
func HandleDCConnSend ¶
func HandleDCConnSend(bwp *BwtestParameters, udpConnection *snet.Conn)
Types ¶
type BwtestParameters ¶
type BwtestParameters struct { BwtestDuration time.Duration PacketSize int64 NumPackets int64 PrgKey []byte Port uint16 }
func DecodeBwtestParameters ¶
func DecodeBwtestParameters(buf []byte) (*BwtestParameters, int, error)
Decode BwtestParameters from byte buffer that is passed in, returns BwtestParameters structure and number of bytes consumed
type BwtestResult ¶
type BwtestResult struct { NumPacketsReceived int64 CorrectlyReceived int64 IPAvar int64 IPAmin int64 IPAavg int64 IPAmax int64 // Contains the client's sending PRG key, so that the result can be uniquely identified // Only requests that contain the correct key can obtain the result PrgKey []byte ExpectedFinishTime time.Time }
func DecodeBwtestResult ¶
func DecodeBwtestResult(buf []byte) (*BwtestResult, int, error)
Decode BwtestResult from byte buffer that is passed in, returns BwtestResult structure and number of bytes consumed
Click to show internal directories.
Click to hide internal directories.