taps

package
v0.3.0-alpha7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// No preference
	Ignore enum.Preference

	// Select only protocols/paths providing the property, fail
	// otherwise
	Require

	// Prefer protocols/paths providing the property, proceed
	// otherwise
	Prefer

	// Prefer protocols/paths not providing the property, proceed
	// otherwise
	Avoid

	// Select only protocols/paths not providing the property,
	// fail otherwise
	Prohibit
)
View Source
const (

	// The connection will not use multiple paths once
	// established, even if the chosen transport supports using
	// multiple paths.
	Disabled enum.MultipathPreference

	// The connection will negotiate the use of multiple paths if
	// the chosen transport supports this.
	Active

	// The connection will support the use of multiple paths if
	// the Remote Endpoint requests it.
	Passive
)
View Source
const (
	// The connection ought only to attempt to migrate between
	// different paths when the original path is lost or becomes
	// unusable.
	Handover enum.MultipathPolicy = iota

	// The connection ought only to attempt to minimize the
	// latency for interactive traffic patterns by transmitting
	// data across multiple paths when this is beneficial. The
	// goal of minimizing the latency will be balanced against the
	// cost of each of these paths. Depending on the cost of the
	// lower-latency path, the scheduling might choose to use a
	// higher-latency path. Traffic can be scheduled such that
	// data may be transmitted on multiple paths in parallel to
	// achieve a lower latency.
	Interactive

	// The connection ought to attempt to use multiple paths in
	// parallel to maximize available capacity and possibly
	// overcome the capacity limitations of the individual paths.
	Aggregate
)
View Source
const (
	// The connection must support sending and receiving data
	Bidirectional enum.Directionality = iota

	// The connection must support sending data, and the application cannot use the connection to receive any data
	UnidirectionalSend

	// The connection must support receiving data, and the application cannot use the connection to send any data
	UnidirectionalReceive
)
View Source
const (
	// The application provides no information about its expected
	// capacity profile.
	Default enum.CapacityProfile = iota

	// The application is not interactive. It expects to send
	// and/or receive data without any urgency. This can, for
	// example, be used to select protocol stacks with scavenger
	// transmission control and/or to assign the traffic to a
	// lower-effort service.
	Scavenger

	// The application is interactive, and prefers loss to
	// latency. Response time should be optimized at the expense
	// of delay variation and efficient use of the available
	// capacity when sending on this connection. This can be used
	// by the system to disable the coalescing of multiple small
	// Messages into larger packets (Nagle's algorithm); to prefer
	// immediate acknowledgment from the peer endpoint when
	// supported by the underlying transport; and so on.
	LowLatencyInteractive

	// The application prefers loss to latency, but is not
	// interactive. Response time should be optimized at the
	// expense of delay variation and efficient use of the
	// available capacity when sending on this connection.
	LowLatencyNonInteractive

	// The application expects to send/receive data at a constant
	// rate after Connection establishment. Delay and delay
	// variation should be minimized at the expense of efficient
	// use of the available capacity. This implies that the
	// Connection might fail if the Path is unable to maintain the
	// desired rate.
	ConstantRateStreaming

	// The application expects to send/receive data at the maximum
	// rate allowed by its congestion controller over a relatively
	// long period of time.
	CapacitySeeking
)
View Source
const (
	SCTP_SS_FCFS   enum.StreamScheduler = iota // First-Come, First-Served Scheduler
	SCTP_SS_RR                                 // Round-Robin Scheduler
	SCTP_SS_RR_PKT                             // Round-Robin Scheduler per Packet
	SCTP_SS_PRIO                               // Priority-Based Scheduler
	SCTP_SS_FC                                 // Fair Capacity Scheduler
	SCTP_SS_WFQ                                // Weighted Fair Queueing Scheduler
)
View Source
const (
	Establishing enum.ConnectionState = iota
	Established
	Closing
	Closed
)

Variables

View Source
var (
	StoppedError            = errors.New("Listener has stopped")
	SendError               = errors.New("Could not send")
	ReceiveError            = errors.New("Could not receive")
	NotYetImplementendError = errors.New("Not yet implemented")
	ExpiredError            = errors.New("The message could not be sent before its lifetime")
	PartialMessageError     = errors.New("Message not yet fully delivered")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Protocols []Protocol
	Services  []Service
}

type Connection

type Connection struct {
	State enum.ConnectionState
	// Need to keep track of ConnPrio Property separately from the
	// other ConnectionProperties. Feedback welcome.
	ConnPrio uint
	// contains filtered or unexported fields
}

Connection

func (*Connection) Abort

func (c *Connection) Abort() error

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) PathChange

func (c *Connection) PathChange() error

PathChange blocks until the underlying transport has signalled a Path Change.

func (*Connection) Receive

func (c *Connection) Receive() (message *Message, err error)

func (*Connection) Send

func (c *Connection) Send(message *Message) error

Send sends a message, blocks until sending has succeeded or returns an error if sending was not successful. This error represents either the "Expired" or "SendError" Events from https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.2.2

func (*Connection) SoftError

func (c *Connection) SoftError() error

Blocks until the underlying transport signals an ICMP error related to the Connection c.

type ConnectionProperties

type ConnectionProperties struct {
	// RecvChecksumLen specifies the minimum number of bytes in a
	// received message that need to be covered by a checksum. A
	// special value of 0 means that a received packet does not
	// need to have a non-zero checksum field. A receiving
	// endpoint will not forward messages that have less coverage
	// to the application. The application is responsible for
	// handling any corruption within the non-protected part of
	// the message [RFC8085]. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.1)
	RecvChecksumLen uint

	// ConnPrio is a non-negative integer representing the
	// relative inverse priority (i.e., a lower value reflects a
	// higher priority) of this Connection relative to other
	// Connections in the same Connection Group. It has no effect
	// on Connections not part of a Connection Group. This
	// property is not entangled when Connections are cloned,
	// i.e., changing the Priority on one Connection in a
	// Connection Group does not change it on the other
	// Connections in the same Connection Group. No guarantees of
	// a specific behavior regarding Connection Priority are
	// given; a Transport Services system may ignore this
	// property. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.2)
	ConnPrio uint

	// ConnTimeout specifies how long to wait before deciding that
	// an active Connection has failed when trying to reliably
	// deliver data to the Remote Endpoint. Adjusting this
	// Property will only take effect when the underlying stack
	// supports reliability. A value of 0 means that no timeout is
	// scheduled. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.3)
	ConnTimeout time.Duration

	// KeepAliveTimeout specifies the maximum length of time an
	// idle connection (one for which no transport packets have
	// been sent) should wait before the Local Endpoint sends a
	// keep-alive packet to the Remote Endpoint. Adjusting this
	// Property will only take effect when the underlying stack
	// supports sending keep-alive packets. Guidance on setting
	// this value for datagram transports is provided in
	// [RFC8085]. A value greater than ConnTimeout or the special
	// value 0 will disable the sending of keep-alive
	// packets. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.4)
	KeepAliveTimeout time.Duration

	// ConnScheduler specifies which scheduler should be used
	// among Connections within a Connection Group. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.5)
	ConnScheduler enum.StreamScheduler

	// ConnCapacityProfile specifies the desired network treatment
	// for traffic sent by the application and the tradeoffs the
	// application is prepared to make in path and protocol
	// selection to receive that desired treatment. When the
	// capacity profile is set to a value other than Default, the
	// Transport Services system SHOULD select paths and configure
	// protocols to optimize the tradeoff between delay, delay
	// variation, and efficient use of the available capacity
	// based on the capacity profile specified. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.6)
	ConnCapacityProfile enum.CapacityProfile

	// MultipathPolicy specifies the local policy for transferring
	// data across multiple paths between the same end hosts if
	// Multipath is not set to Disabled in TransportProperty. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.7)
	MultipathPolicy enum.MultipathPolicy

	// [Max|Min][Send|Recv]Rate specifies an upper-bound rate that
	// a transfer is not expected to exceed (even if flow control
	// and congestion control allow higher rates), and/or a
	// lower-bound rate below which the application does not deem
	// it will be useful. These are specified in bits per
	// second. The special value of 0 (alternatively: a Max Rate
	// set lower than the corresponding Min Rate) indicates that
	// no bound is specified.  (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.8)
	MinSendRate, MinRecvRate, MaxSendRate, MaxRecvRate uint

	// GroupConnLimit controls the number of Connections that can
	// be accepted from a peer as new members of the Connection's
	// group. Similar to SetNewConnectionLimit(), this limits the
	// number of ConnectionReceived Events that will occur, but
	// constrained to the group of the Connection associated with
	// this property. For a multi-streaming transport, this limits
	// the number of allowed streams. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.9)
	GroupConnLimit uint

	// IsolateSession, when set, will initiate new Connections
	// using as little cached information (such as session tickets
	// or cookies) as possible from previous connections that are
	// not in the same Connection Group. Any state generated by
	// this Connection will only be shared with Connections in the
	// same Connection Group. Cloned Connections will use saved
	// state from within the Connection Group. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.10)
	IsolateSession bool
	// contains filtered or unexported fields
}

func (*ConnectionProperties) Copy

Copy returns a new ConnectionProperties struct with its values deeply copied from cp

func (*ConnectionProperties) RecvMsgMaxLen

func (cp *ConnectionProperties) RecvMsgMaxLen() uint

RecvMsgMaxLen returns the maximum Message size that an application can receive, in bytes.

(See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.11.4)

func (*ConnectionProperties) SendMsgMaxLen

func (cp *ConnectionProperties) SendMsgMaxLen() uint

SendMsgMaxLen returns the maximum Message size that an application can send, in bytes.

(See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.11.3)

func (*ConnectionProperties) SingularTransmissionMsgMaxLen

func (cp *ConnectionProperties) SingularTransmissionMsgMaxLen() uint

SingularTransmissionMsgMaxLen, if applicable, returns the maximum Message size that can be sent without incurring network-layer fragmentation at the sender, in bytes.

(See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.11.2)

func (*ConnectionProperties) ZeroRTTMsgMaxLen

func (cp *ConnectionProperties) ZeroRTTMsgMaxLen() uint

ZeroRTTMsgMaxLen returns the maximum Message size that can be sent before or during Connection establishment in bytes.

(See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-8.1.11.1)

type Endpoint

type Endpoint struct {
	Address   net.Addr
	Transport string
	Network   string
	Interface string
}

func (*Endpoint) Copy

func (e *Endpoint) Copy() *Endpoint

Copy returns a new Endpoint struct with its values deeply copied from e

func (*Endpoint) WithHostname

func (e *Endpoint) WithHostname(name string)

func (*Endpoint) WithIPv4Address

func (e *Endpoint) WithIPv4Address(addr net.IPAddr)

func (*Endpoint) WithIPv6Address

func (e *Endpoint) WithIPv6Address(addr net.IPAddr)

func (*Endpoint) WithInterface

func (e *Endpoint) WithInterface(intf string)

func (*Endpoint) WithNetwork

func (e *Endpoint) WithNetwork(network string)

func (*Endpoint) WithPort

func (e *Endpoint) WithPort(port int)

func (*Endpoint) WithProtocol

func (e *Endpoint) WithProtocol(proto Protocol)

func (*Endpoint) WithTransport

func (e *Endpoint) WithTransport(transport string)

type EstablishmentError

type EstablishmentError error

func NewEstablishmentError

func NewEstablishmentError(reason string) EstablishmentError

type Framer

type Framer interface {
	Encode(kv map[string]interface{}, dst io.Writer, src io.Reader) (written int64, err error)
	Decode(kv map[string]interface{}, dst io.Writer, src io.Reader) (written int64, err error)
}

type HTTPMessageFramer

type HTTPMessageFramer struct {
	KeyValue map[string]string
}

func (*HTTPMessageFramer) Decode

func (h *HTTPMessageFramer) Decode(kv map[string]interface{}, dst io.Writer, src io.Reader) (written int64, err error)

func (*HTTPMessageFramer) Encode

func (h *HTTPMessageFramer) Encode(kv map[string]interface{}, dst io.Writer, src io.Reader) (written int64, err error)

type KeyPair

type KeyPair struct {
	PrivateKey crypto.PrivateKey
	PublicKey  crypto.PublicKey
}

KeyPair clearly associates a Private and Public Key into a pair

type Listener

type Listener struct {
	Preconnection Preconnection
}

Listener passively waits for Connections from RemoteEndpoints.

See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-7.2

func (*Listener) Accept

func (l *Listener) Accept() (Connection, error)

Accept blocks until it receives the next incoming connection and returns it

func (*Listener) SetNewConnectionLimit

func (l *Listener) SetNewConnectionLimit(value uint)

SetNewConnectionLimit sets a cap on the number of inbound Connections that will be delivered.

func (*Listener) Stop

func (l *Listener) Stop() error

Stop stops the Listener l

type LocalEndpoint

type LocalEndpoint struct{ Endpoint }

func NewLocalEndpoint

func NewLocalEndpoint() *LocalEndpoint

type Message

type Message struct {
	// MessageContext is an optional pointer to a context object
	// for this Message
	*MessageContext

	// Data provides access to the bytes that are to be sent OR
	// that have been received for this Message
	Data []byte

	// EndOfMessage is flag that indicates whether, for the
	// purposes of the underlying transport, this message has been
	// completely submitted for transmission OR whether it has
	// been completely received from the underlying connection
	EndOfMessage bool
}

type MessageContext

type MessageContext struct {
	// MsgLifetime specifies how long a particular Message can
	// wait to be sent to the Remote Endpoint before it is
	// irrelevant and no longer needs to be (re-)transmitted. This
	// is a hint to the Transport Services system - it is not
	// guaranteed that a Message will not be sent when its
	// Lifetime has expired.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.1
	MsgLifetime time.Duration

	// MsgPrio specifies the priority of a Message, relative to
	// other Messages sent over the same Connection.A Message with
	// Priority 0 will yield to a Message with Priority 1, which
	// will yield to a Message with Priority 2, and so
	// on. Priorities may be used as a sender-side scheduling
	// construct only, or be used to specify priorities on the
	// wire for Protocol Stacks supporting prioritization.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.2
	MsgPrio uint

	// MsgOrdered, if true, preserves the order on delivery in
	// which Messages were originally submitted.
	//
	// Deprecated: The TAPS spec sets the default of this value to
	// "the queried Boolean value of the Selection Property
	// preserveOrder", but the latter is never actually in
	// scope/queriable when the MessageContext object is
	// created. Not setting the parameter defaults to "false",
	// which is indistinguishable from actively setting it to
	// "false". Feedback welcome.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.3
	MsgOrdered bool

	// SafelyReplayable, if true, specifies that a Message is safe
	// to send to the Remote Endpoint more than once for a single
	// Send Action. It marks the data as safe for certain 0-RTT
	// establishment techniques, where retransmission of the 0-RTT
	// data may cause the remote application to receive the
	// Message multiple times.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.4
	SafelyReplayable bool

	// Final, if true, this indicates a Message is the last that
	// the application will send on a Connection. This allows
	// underlying protocols to indicate to the Remote Endpoint
	// that the Connection has been effectively closed in the
	// sending direction. For example, TCP-based Connections can
	// send a FIN once a Message marked as Final has been
	// completely sent, indicated by marking
	// endOfMessage. Protocols that do not support signalling the
	// end of a Connection in a given direction will ignore this
	// property.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.5
	Final bool

	// MsgChecksumLen specifies the minimum length of the section
	// of a sent Message, starting from byte 0, that the
	// application requires to be delivered without corruption due
	// to lower layer errors. It is used to specify options for
	// simple integrity protection via checksums. A value of 0
	// means that no checksum needs to be calculated, and Full
	// Coverage means that the entire Message needs to be
	// protected by a checksum. Only Full Coverage is guaranteed,
	// any other requests are advisory, which may result in Full
	// Coverage being applied.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.6
	MsgChecksumLen uint

	// MsgReliable, if true, specifies that a Message should be
	// sent in such a way that the transport protocol ensures all
	// data is received on the other side without
	// corruption. Changing the Reliable Data Transfer property on
	// Messages is only possible for Connections that were
	// established enabling the Selection Property Configure
	// Per-Message Reliability. When this is not the case,
	// changing msgReliable will generate an error.
	//
	// Deprecated: The TAPS spec sets the default of this value to
	// "the queried Boolean value of the Selection Property
	// reliability", but the latter is never actually in
	// scope/queriable when the MessageContext object is
	// created. Not setting the parameter defaults to "false",
	// which is indistinguishable from actively setting it to
	// "false". Feedback welcome.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.7
	MsgReliable bool

	// MsgCapacityProfile specifies the application's preferred
	// tradeoffs for sending this Message; it is a per-Message
	// override of the CapacityProfile ConnectionProperty
	//
	// Implementation note: The TAPS spec sets the default of this
	// value to "inherited from the Connection Property
	// connCapacityProfile", but the latter is never actually in
	// scope/queriable when the MessageContext object is
	// created. However, the default "Default" CapacityProfile is
	// defined as "no information about the expected capacity
	// profile", which this implementation interprets as "no
	// override" for the purposes of MessageContext. Feedback
	// welcome.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.8
	MsgCapacityProfile enum.CapacityProfile

	// NoFragmentation specifies that a message should be sent and
	// received without network-layer fragmentation, if
	// possible. It can be used to avoid network layer
	// fragmentation when transport segmentation is prefered.
	//
	// This only takes effect when the transport uses a network
	// layer that supports this functionality. When it does take
	// effect, setting this property to true will cause the sender
	// to avoid network-layer source frgementation. When using
	// IPv4, this will result in the Don't Fragment bit being set
	// in the IP header.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.9
	NoFragmentation bool

	// NoSegmentation, if set, requests the transport layer to not
	// provide segmentation of messages larger than the maximum
	// size permitted by the network layer, and also to avoid
	// network-layer source fragmentation of messages. When
	// running over IPv4, setting this property to true can result
	// in a sending endpoint setting the Don't Fragment bit in the
	// IPv4 header of packets generated by the transport layer. An
	// attempt to send a message that results in a size greater
	// than the transport's current estimate of its maximum packet
	// size (singularTransmissionMsgMaxLen) will result in a
	// SendError. This only takes effect when the transport and
	// network layer support this functionality.
	//
	// See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-9.1.3.10
	NoSegmentation bool
	// contains filtered or unexported fields
}

MessageContext carries extra information that an application might wish to attach to a Message

As laid out in the TAPS spec, this type of Object is reminiscent of https://pkg.go.dev/context, which could conceivably also be used instead of this dedicated MessageContext Type. Feedback welcome.

func NewMessageContext

func NewMessageContext() *MessageContext

func (*MessageContext) LocalEndpoint

func (mc *MessageContext) LocalEndpoint() *LocalEndpoint

LocalEndpoint can be called by the application to query information about the Local Endpoint

func (*MessageContext) RemoteEndpoint

func (mc *MessageContext) RemoteEndpoint() *RemoteEndpoint

RemoteEndpoint can be called by the application to query information about the Remote Endpoint

type Preconnection

type Preconnection struct {
	LocalEndpoints      []*LocalEndpoint
	RemoteEndpoints     []*RemoteEndpoint
	TransportProperties *TransportProperties
	SecurityParameters  *SecurityParameters
}

Preconnection is a passive data structure that merely maintains the state that describes the properties of a Connection that might exist in the future.

func NewPreconnection

func NewPreconnection(
	LocalEndpoints []*LocalEndpoint,
	RemoteEndpoints []*RemoteEndpoint,
	TransportProperties *TransportProperties,
	SecurityParameters *SecurityParameters,
) *Preconnection

NewPreconnection returns a struct representing a potential Connection.

At least one Local Endpoint MUST be specified if the Preconnection is used to Listen() for incoming Connections, but the list of Local Endpoints MAY be empty if the Preconnection is used to Initiate() connections.

myPreconnection := NewPreconnection(
  myEndpoints,
  []*RemoteEndpoint{},   // leave empty, we just want to Listen()
  myTransportProperties,
  nil,                   // no SecurityParameters for this NewPreconnection
)

Note that it would be idiomatic Go to do the above with a struct literal, leaving all unset Fields at their appropriate zero value

myPreconnection := Preconnection{
  LocalEndpoints: myEndpoints,
  TransportProperties: myTransportProperties,
}

See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6

func (*Preconnection) AddRemote deprecated

func (p *Preconnection) AddRemote([]*RemoteEndpoint)

AddRemote can add RemoteEndpoints obtained via p.Resolve() to the Preconnection p.

Deprecated: The spec is unclear why p.Resolve() should not modify p directly. It is also unclear how calling AddRemote modifies the existing set of RemoteEndpoints configured in p. Are they overwritten or merely appended to? Feedback welcome.

func (*Preconnection) Copy

func (p *Preconnection) Copy() *Preconnection

Copy returns a new Preconnection struct with its values deeply copied from p

func (*Preconnection) Initiate

func (p *Preconnection) Initiate() (Connection, error)

func (*Preconnection) Listen

func (p *Preconnection) Listen() (*Listener, error)

Listen returns a Listener object. Once Listen() has been called, any changes to the Preconnection do not have any effect on the Listener. The Preconnection can be disposed of or reused, e.g., to create another Listener.

See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-7.2

func (*Preconnection) Rendezvous

func (p *Preconnection) Rendezvous() (Connection, error)

Rendezvous listens on the Local Endpoint candidates for an incoming Connection from the Remote Endpoint candidates, while also simultaneously trying to establish a Connection from the Local Endpoint candidates to the Remote Endpoint candidates. See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-7.3

func (*Preconnection) Resolve

func (p *Preconnection) Resolve() (les []*LocalEndpoint, res []*RemoteEndpoint, err error)

Resolve called on a Preconnection p can be used by the application to force early binding when required, for example with some Network Address Translator (NAT) traversal protocols.

See https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.1 and https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-7.3

type Protocol

type Protocol interface {
	Dial(Endpoint) (io.ReadWriteCloser, error)
	Accept(Endpoint) (io.ReadWriteCloser, error)
}

type RemoteEndpoint

type RemoteEndpoint struct{ Endpoint }

func NewRemoteEndpoint

func NewRemoteEndpoint() *RemoteEndpoint

type SecurityParameters

type SecurityParameters struct {
	// Local identity and private keys: Used to perform private
	// key operations and prove one's identity to the Remote
	// Endpoint.
	Identity string
	KeyPair  KeyPair

	// Supported algorithms: Used to restrict what parameters are
	// used by underlying transport security protocols. When not
	// specified, these algorithms should use known and safe
	// defaults for the system. Parameters include: ciphersuites,
	// supported groups, and signature algorithms. These
	// parameters take a collection of supported algorithms as
	// parameter.
	SupportedGroup        tls.CurveID
	CipherSuite           *tls.CipherSuite
	SignatureAlgorithm    tls.SignatureScheme
	MaxCachedSessions     uint
	CachedSessionLifetime time.Duration

	// Unsupported
	PSK crypto.PrivateKey
}

SecurityParameters is a structure used to configure security for a Preconnection

func NewDisabledSecurityParameters

func NewDisabledSecurityParameters() *SecurityParameters

NewDisabledSecurityParameters is intended for compatibility with endpoints that do not support transport security protocols (such as TCP without support for TLS)

func NewOpportunisticSecurityParameters

func NewOpportunisticSecurityParameters() *SecurityParameters

NewOpportunisticSecurityParameters() is not yet implemented

func NewSecurityParameters

func NewSecurityParameters() *SecurityParameters

NewSecurityParameters TODO

func (*SecurityParameters) Copy

Copy returns a new SecurityParameters struct with its values deeply copied from sp

func (SecurityParameters) SetIdentityChallengeCallback

func (sp SecurityParameters) SetIdentityChallengeCallback()

SetIdentityChallengeCallback is not yet implemented

func (SecurityParameters) SetTrustVerificationCallback

func (sp SecurityParameters) SetTrustVerificationCallback()

SetTrustVerificationCallback is not yet implemented

type Service

type Service interface {
	GetPort() int //uint16?

}

type TransportProperties

type TransportProperties struct {
	// Reliability pecifies whether the application needs to use a
	// transport protocol that ensures that all data is received
	// at the Remote Endpoint without corruption. When reliable
	// data transfer is enabled, this also entails being notified
	// when a Connection is closed or aborted. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.1)
	Reliability enum.Preference

	// PreserveMsgBoundaries specifies whether the application
	// needs or prefers to use a transport protocol that preserves
	// message boundaries. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.2)
	PreserveMsgBoundaries enum.Preference

	// PerMsgReliability specifies whether an application
	// considers it useful to specify different reliability
	// requirements for individual Messages in a Connection. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.3)
	PerMsgReliability enum.Preference

	// PreserveOrder specifies whether the application wishes to
	// use a transport protocol that can ensure that data is
	// received by the application on the other end in the same
	// order as it was sent. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.4)
	PreserveOrder enum.Preference

	// ZeroRTTMsg specifies whether an application would like to
	// supply a Message to the transport protocol before
	// Connection establishment that will then be reliably
	// transferred to the other side before or during Connection
	// establishment. This Message can potentially be received
	// multiple times (i.e., multiple copies of the message data
	// may be passed to the Remote Endpoint). (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.5)
	ZeroRTTMsg enum.Preference

	// Multistreaming specifies that the application would prefer
	// multiple Connections within a Connection Group to be
	// provided by streams of a single underlying transport
	// connection where possible.  (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.6)
	Multistreaming enum.Preference

	// FullChecksumSend specifies the application's need for
	// protection against corruption for all data transmitted on
	// this Connection. Disabling this property could enable later
	// control of the sender checksum coverage. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.7)
	FullChecksumSend enum.Preference

	// FullChecksumRecv specifies the application's need for
	// protection against corruption for all data received on this
	// Connection. Disabling this property could enable later
	// control of the required minimum receiver checksum
	// coverage. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.8)
	FullChecksumRecv enum.Preference

	// CongestionControl specifies whether the application would like
	// the Connection to be congestion controlled or not. Note
	// that if a Connection is not congestion controlled, an
	// application using such a Connection SHOULD itself perform
	// congestion control in accordance with [RFC2914] or use a
	// circuit breaker in accordance with [RFC8084], whichever is
	// appropriate. Also note that reliability is usually combined
	// with congestion control in protocol implementations,
	// rendering "reliable but not congestion controlled" a
	// request that is unlikely to succeed. If the Connection is
	// congestion controlled, performing additional congestion
	// control in the application can have negative performance
	// implications. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.9)
	CongestionControl enum.Preference

	// KeepAlive specifies whether the application would like the
	// Connection to send keep-alive packets or not. Note that if
	// a Connection determines that keep-alive packets are being
	// sent, the applicaton should itself avoid generating
	// additional keep alive messages. Note that when supported,
	// the system will use the default period for generation of
	// the keep alive-packets. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.10)
	KeepAlive enum.Preference

	// Interface allows the application to select any specific
	// network interfaces or categories of interfaces it wants to
	// Require, Prohibit, Prefer, or Avoid. Note that marking a
	// specific interface as Require strictly limits path
	// selection to that single interface, and often leads to less
	// flexible and resilient connection establishment. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.11)
	//
	// Implementation Detail: In contrast to other Selection
	// Properties, this property maps interface identifier strings
	// to Preferences. In future, common interface types might
	// exist as constants.
	Interface map[string]enum.Preference

	// PvD allows the application to control path selection by
	// selecting which specific Provisioning Domain (PvD) or
	// categories of PVDs it wants to Require, Prohibit, Prefer,
	// or Avoid. Provisioning Domains define consistent sets of
	// network properties that may be more specific than network
	// interfaces [RFC7556]. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.12)
	//
	// Implementation Detail: In contrast to other Selection
	// Properties, this property maps PvD identifier strings to
	// Preferences. In future, common PvD types and categories
	// might exist as constants.
	PvD map[string]enum.Preference

	// Multipath specifies whether and how applications want to
	// take advantage of transferring data across multiple paths
	// between the same end hosts. Using multiple paths allows
	// connections to migrate between interfaces or aggregate
	// bandwidth as availability and performance properties
	// change.
	//
	// The policy for using multiple paths is specified using the
	// separate MultipathPolicy ConnectionProperty. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.14)
	Multipath enum.MultipathPreference

	// UseTemporaryLocalAddress allows the application to express
	// a preference for the use of temporary local addresses,
	// sometimes called "privacy" addresses [RFC4941]. Temporary
	// addresses are generally used to prevent linking connections
	// over time when a stable address, sometimes called
	// "permanent" address, is not needed. There are some caveats
	// to note when specifying this property. First, if an
	// application Requires the use of temporary addresses, the
	// resulting Connection cannot use IPv4, because temporary
	// addresses do not exist in IPv4. Second, temporary local
	// addresses might involve trading off privacy for
	// performance. For instance, temporary addresses can
	// interfere with resumption mechanisms that some protocols
	// rely on to reduce initial latency. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.13)
	UseTemporaryLocalAddress enum.Preference

	// AdvertisesAltAddr specifies whether alternative addresses,
	// e.g., of other interfaces, should be advertised to the peer
	// endpoint by the protocol stack. Advertising these addresses
	// enables the peer-endpoint to establish additional
	// connectivity, e.g., for connection migration or using
	// multiple paths. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.15)
	AdvertisesAltAddr bool

	// Direction specifies whether an application wants to use the connection for sending and/or receiving data.
	//
	// Since unidirectional communication can be supported by
	// transports offering bidirectional communication, specifying
	// unidirectional communication may cause a transport stack
	// that supports bidirectional communication to be
	// selected. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.16)
	Direction enum.Directionality

	// SoftErrorNotify specifies whether an application considers
	// it useful to be informed when an ICMP error message arrives
	// that does not force termination of a connection. When set
	// to true, received ICMP errors are available as
	// SoftErrors. Note that even if a protocol supporting this
	// property is selected, not all ICMP errors will necessarily
	// be delivered, so applications cannot rely upon receiving
	// them [RFC8085]. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.17)
	SoftErrorNotify enum.Preference

	// ActiveReadBeforeSend specifies whether an application wants
	// to diverge from the most common communication pattern - the
	// client actively opening a connection, then sending data to
	// the server, with the server listening (passive open),
	// reading and then answering. ActiveReadBeforeSend departs
	// from this pattern, either by actively opening with
	// Initiate(), immediately followed by reading, or passively
	// opening with Listen(), immediately followed by
	// writing. This property is ignored when establishing
	// connections using Rendezvous(). Requiring this property
	// limits the choice of mappings to underlying protocols,
	// which can reduce efficiency. For example, it prevents the
	// Transport Services system from mapping Connections to SCTP
	// streams, where the first transmitted data takes the role of
	// an active open signal. (See
	// https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2.18)
	ActiveReadBeforeSend enum.Preference
}

TransportProperties (TODO: rename to SelectionProperties)

func NewTransportProperties

func NewTransportProperties() *TransportProperties

NewTransportProperties creates TransportProperties with the recommended defaults from https://www.ietf.org/archive/id/draft-ietf-taps-interface-13.html#section-6.2

func (*TransportProperties) Copy

Copy returns a new TransportProperties struct with its values deeply copied from tp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL