Hi Sabine and all,

After reviewing cost context, I think a possible solution to introduce cost 
context is to extend the existing specification of CostType. Below is my 
proposal.

The CostType defined in [RFC7285] is:

object CostType {
        CostMetric cost-metric;
        CostMode cost-mode;
        [JSONString description;]
}

Since cost-context is used to describe the different parameters for one metric, 
so I propose to extend CostType as follows:

object CostType {
        CostMetric cost-metric;
        CostMode cost-mode;
        [CostContext cost-context<1..*>;]
        [JSONString description;]
}

The definition of CostContext can be done later. Each cost-context may be like 
["uda", "uplink"] which describe a specific metric context.

So, the IRD may be:

{
  "meta" : {
    "cost-type" : {
      "num-routingcost": {
        "cost-mode": "numerical",
        "cost-metric" : "routingcost"
      },
      "num-RFcost" : {
        "cost-mode" : "numerical",
        "cost-metric" : "RFcost"
        "cost-context" : [["uda", "uplink"],
                          ["uda", "downlink"],
                          ["udna", "uplink"],
                          ["udna", "downlink"]]
      }
    }
  }
  "resources" : {
    ...An endpointcost resource which supports multi-cost and cost-calendar...
    "calendared-endpointcost-map" : {
      "uri": "http://alto.local.example.com/endpointcostmap//lookup/context";,
      "media-types" : [ "application/alto-endpointcost+json" ],
      "accepts" : [ "application/alto-endpointcostparams+json" ],
      "capabilities" : {
        "cost-type-names" : [ "num-routingcost",
                              "num-RFcost" ],
        "calendar-attributes" : [
          { "cost-type-names" : "num-routingcost",
            "time-interval-size" : "1 hour",
            "number-of-intervals" : 24 },
          { "cost-type-names" : "num-RFcost",
            "time-interval-size" : "5 minute",
            "number-of-intervals" : 12 }
        ]
      }
    }
  }
}

A possible query and response would be like:

POST /endpointcost/lookup/context HTTP/1.1
Host: alto.local.example.com
Content-Length: [TODO]
Content-Type: application/alto-endpointcostparams+json
Accept: application/alto-endpointcost+json,application/alto-error+json
{
  "cost-type" : {},
  "multi-cost-types" : [ { "cost-mode" : "numerical", "cost-metric" : 
"routingcost" },
                          { "cost-mode" : "numerical", "cost-metric" : 
"RFcsot", "cost-context" : [ [ "uda", "uplink" ],[ "uda", "downlink” ] ] }
  ]
  "endpoints" : {
    "srcs": [ "ipv4:192.0.2.2" ],
    "dsts": [ "ipv4:192.0.2.89",
              "ipv6:2000::1:2345:6789:abcd"]
  }
}

HTTP/1.1 200 OK
Content-Length: [TODO]
Content-Type: application/alto-endpointcost+json
{
  "meta" : {
    "multi-cost-types" : [
      { "cost-mode" : "numerical", "cost-metric" : "routingcost" },
      { "cost-mode" : "numerical", "cost-metric" : "RFcsot", "cost-context" : 
[[ "uda", "uplink" ],[ "uda", "downlink" ]]
      // Here, suppose only the contextual parameters ["uda", "uplink"] and 
["uda", "downlink"] are needed.
      }
    ],
    "calendar-response-attributes" : [
      { "cost-type-name : num-routingcost"
        "calendar-start-time" : Mon, 30 Jun 2014 00:00:00 GMT,
        "time-interval-size" : "1 hour",
        "numb-intervals" : 24,
      },
      { "cost-type-name : num-latency"
        "calendar-start-time" : Tue, 1 Jul 2014 13:00:00 GMT,
        "time-interval-size" : "5 minute",
        "numb-intervals" : 12
      }
    ],
  } // end meta
  "endpoint-cost-map" : {
  "ipv4:192.0.2.2": {
    "ipv4:192.0.2.89"    : [ [r1, r2, ... r24], [ 
[l1-uda-uplink,l1-uda-downlink], [l2-uda-uplink,l2-uda-downlink], ... 
[l12-uda-uplink,l12-uda-downlink] ] ],
    "ipv6:2000::1:2345:6789:abcd" : [ [r1, r2, ... r24], [ 
[l1-uda-uplink,l1-uda-downlink], [l2-uda-uplink,l2-uda-downlink], ... 
[l12-uda-uplink,l12-uda-downlink] ] ]
} }
}


Here we may change the knowledge of cost value. Each cost value represented a 
combination of a cost-mode and a cost-metric as defined in RFC7285, but now, 
each cost value may represent a combination of a cost-mode, a cost-metric and a 
specific cost-context value.

Such design idea seems to be compatible with multi-cost and cost-calendar.

What do you think of this idea? Wish to hear your reply.

Best Regards,
Dawn

_______________________________________________
alto mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/alto

Reply via email to