Documentation ¶
Index ¶
- type CleanupReq
- type Index
- type Indices
- func (idxs Indices) GetAllocBW(i int) reservation.BWCls
- func (idxs Indices) GetExpiration(i int) time.Time
- func (idxs Indices) GetIndexNumber(i int) reservation.IndexNumber
- func (idxs Indices) GetToken(i int) *reservation.Token
- func (idxs Indices) Len() int
- func (idxs Indices) Rotate(i int) base.IndicesInterface
- type PathLocation
- type Request
- type Reservation
- type Response
- type ResponseCleanupFailure
- type ResponseCleanupSuccess
- type ResponseSetupFailure
- type ResponseSetupSuccess
- type SetupReq
- type SetupReqFailure
- type SetupReqSuccess
- type SetupRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanupReq ¶
type CleanupReq struct {
Request
}
CleanupReq is a cleaup request for an e2e index.
type Index ¶
type Index struct { Idx reservation.IndexNumber Expiration time.Time AllocBW reservation.BWCls // also present in the token Token *reservation.Token }
Index represents an E2E index. These are interpreted as "active", so the reservation initiator must cleanup indices along the path when the setup didn't finish correctly.
type Indices ¶
type Indices []Index
func (Indices) GetAllocBW ¶
func (idxs Indices) GetAllocBW(i int) reservation.BWCls
func (Indices) GetIndexNumber ¶
func (idxs Indices) GetIndexNumber(i int) reservation.IndexNumber
type PathLocation ¶
type PathLocation int
const ( Source PathLocation = iota Transit Destination )
func (PathLocation) String ¶
func (l PathLocation) String() string
type Request ¶
type Request struct { base.RequestMetadata // information about the request (forwarding path) ID reservation.E2EID // the ID this request refers to Index reservation.IndexNumber // the index this request refers to Timestamp time.Time // the mandatory timestamp }
Request is the base struct for any type of COLIBRI e2e request.
func NewRequest ¶
func NewRequest(ts time.Time, id *reservation.E2EID, idx reservation.IndexNumber, path base.ColibriPath) (*Request, error)
NewRequest constructs the e2e Request type.
type Reservation ¶
type Reservation struct { ID reservation.E2EID SegmentReservations []*segment.Reservation // stitched segment reservations Indices Indices }
Reservation represents an E2E reservation.
func (*Reservation) AllocResv ¶
func (r *Reservation) AllocResv() uint64
AllocResv returns the allocated bandwidth by this reservation using the current active index and the previous one. The max of those two values is used because the current active index might be rolled back with a cleanup request. The return units is Kbps.
func (*Reservation) Index ¶
func (r *Reservation) Index(idx reservation.IndexNumber) *Index
Index finds the Index with that IndexNumber and returns a pointer to it. Nil if not found.
func (*Reservation) NewIndex ¶
func (r *Reservation) NewIndex(expTime time.Time) (reservation.IndexNumber, error)
NewIndex creates a new index in this reservation. The token needs to be created manually.
func (*Reservation) RemoveIndex ¶
func (r *Reservation) RemoveIndex(idx reservation.IndexNumber) error
RemoveIndex removes all indices from the beginning until this one, inclusive.
func (*Reservation) Validate ¶
func (r *Reservation) Validate() error
Validate will return an error for invalid values. It doesn not check for valid path properties and correct end/start AS ID when stiching.
type Response ¶
type Response struct { base.RequestMetadata // information about the request (forwarding path) ID reservation.E2EID // the ID this request refers to Index reservation.IndexNumber // the index this request refers to Accepted bool // success or failure type of response FailedHop uint8 // if accepted is false, the AS that failed it }
Response is the base struct for any type of COLIBRI e2e response.
func NewResponse ¶
func NewResponse(ts time.Time, id *reservation.E2EID, idx reservation.IndexNumber, path base.ColibriPath, accepted bool, failedHop uint8) (*Response, error)
NewResponse contructs the segment Response type.
func (*Response) IsHopByHop ¶
IsHopByHop returns false, as all the responses travel directly to the source endhost.
type ResponseCleanupFailure ¶
ResponseCleanupFailure is a failed index cleanup.
type ResponseCleanupSuccess ¶
type ResponseCleanupSuccess struct {
Response
}
ResponseCleanupSuccess is a response to a successful cleanup request.
type ResponseSetupFailure ¶
type ResponseSetupFailure struct { Response ErrorCode uint8 MaxBWs []reservation.BWCls // granted by ASes in the path until the failed hop }
ResponseSetupFailure is the response to a failed setup. It's sent on the reverse direction. The failed hop is the length of MaxBWs + 1.
type ResponseSetupSuccess ¶
type ResponseSetupSuccess struct { Response Token reservation.Token }
ResponseSetupSuccess is the response to a success setup. It's sent on the reverse direction.
type SetupReq ¶
type SetupReq struct { Request SegmentRsvs []reservation.SegmentID SegmentRsvASCount []uint8 // how many ASes per segment reservation RequestedBW reservation.BWCls AllocationTrail []reservation.BWCls // contains filtered or unexported fields }
SetupReq is an e2e setup/renewal request, that has been so far accepted.
func NewSetupRequest ¶
func NewSetupRequest(r *Request, segRsvs []reservation.SegmentID, segRsvCount []uint8, requestedBW reservation.BWCls, allocTrail []reservation.BWCls) (*SetupReq, error)
NewSetupRequest creates and initializes an e2e setup request common for both success and failure.
func (*SetupReq) GetCommonSetupReq ¶
GetCommonSetupReq returns the pointer to the data structure.
func (*SetupReq) Location ¶
func (r *SetupReq) Location() PathLocation
Location returns the location of this node in the path of the request.
func (*SetupReq) SegmentRsvIDsForThisAS ¶
func (r *SetupReq) SegmentRsvIDsForThisAS() []reservation.SegmentID
SegmentRsvIDsForThisAS returns the segment reservation ID this AS belongs to. Iff this AS is a transfer AS (stitching point), there will be two reservation IDs returned, in the order of traversal.
type SetupReqFailure ¶
SetupReqFailure is a failed e2e setup request also traveling along the reservation path.
func (*SetupReqFailure) IsSuccessful ¶
func (s *SetupReqFailure) IsSuccessful() bool
IsSuccessful returns false, as this is a failed setup.
type SetupReqSuccess ¶
type SetupReqSuccess struct { SetupReq Token reservation.Token }
SetupReqSuccess is a successful e2e setup request traveling along the reservation path.
func (*SetupReqSuccess) IsSuccessful ¶
func (s *SetupReqSuccess) IsSuccessful() bool
IsSuccessful returns true.
type SetupRequest ¶
type SetupRequest interface { IsSuccessful() bool GetCommonSetupReq() *SetupReq // return the underlying basic SetupReq (common for all) }
SetupRequest represents all possible e2e setup requests.