Diagnostics

Diag/observations

Get observation post info

Sample request 

List all observations:

GET /sdn/v2.0/diag/observations

List all observations by the specified packet identifier:

GET /sdn/v2.0/diag/observations?packet_uid="2"

List all observations by the specified packet type:

GET /sdn/v2.0/diag/observations?packet_type="TCP"

There is no request body for this API.

Sample response 

{
   "observations":[
      {
         "dpid":"00:00:00:00:00:00:00:01",
         "type":"TCP",
         "packet_uid":"1",
         "status":"OK"
      },
      {
         "dpid":"00:00:00:00:00:00:00:01",
         "type":"UDP",
         "packet_uid":"2"
      },
      {
         "dpid":"00:00:00:00:00:00:00:02",
         "type":"UDP",
         "packet_uid":"2"
      },
      {
         "dpid":"00:00:00:00:00:00:00:03",
         "type":"UDP",
         "packet_uid":"2"
      },
      {
         "dpid":"00:00:00:00:00:00:00:03",
         "type":"DHCP",
         "packet_uid":"3"
      },
      {
         "dpid":"00:00:00:00:00:00:00:03",
         "type":"ICMP",
         "packet_uid":"4"
      }
   ]
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Create an observation post

Sample request 

Create an observation post:

POST /sdn/v2.0/diag/observations

Sample request body:

{
   "observation":{
      "dpid":"00:00:00:00:00:00:00:01",
      "packet_uid":"1"
   }
}

Sample response 

{
   "observation":{
      "dpid":"00:00:00:00:00:00:00:01",
      "packet_uid":"1"
   }
}

Response codes 

  • Normal: Created (201)

  • Error: Bad Request (400), Unauthorized (401), Service Unavailable (503)

Delete an observation post

Sample request 

Delete an observation post with the given data path id and the packet identifier:

DELETE /sdn/v2.0/diag/observations

Sample request body:

{
   "observation":{
      "dpid":"00:00:00:00:00:00:00:01",
      "packet_uid":"1"
   }
}

Sample response 

There is no response body.

Response codes 

  • Normal: No Content (204)

  • Error: Unauthorized (401), Service Unavailable (503)

Diag/packets

List all packets

Sample request 

List all packets:

GET /sdn/v2.0/diag/packets

List all observations by the specified packet type:

GET /sdn/v2.0/diag/packets?type="TCP"

There is no request body for this API.

Sample response 

{
   "packets":[
      {
         "uid":"1",
         "eth":{
            "eth_src":"01:01:01:01:01:01",
            "eth_dst":"02:02:02:02:02:02",
            "eth_type":"0x0800(IPv4)",
            "vlan_vid":"100",
            "vlan_priority":"PRIORITY_5"
         },
         "ip":{
            "ipv4_dst":"10.0.100.102",
            "ipv4_src":"10.0.100.101",
            "ip_proto":"TCP",
            "ip_dscn":"CS0",
            "ip_scn":"NOT_ECT"
         },
         "tcp":{
            "tcp_dst":80,
            "tcp_src":12345
         }
      },
      {
         "uid":"2",
         "eth":{
            "eth_src":"01:01:01:01:01:01",
            "eth_dst":"02:02:02:02:02:02",
            "eth_type":"0x0800(IPv4)",
            "vlan_vid":"100",
            "vlan_priority":"PRIORITY_5"
         },
         "ip":{
            "ipv4_dst":"10.0.100.102",
            "ipv4_src":"10.0.100.101",
            "ip_proto":"UDP",
            "ip_dscn":"CS0",
            "ip_scn":"NOT_ECT"
         },
         "udp":{
            "udp_dst":152,
            "udp_src":12345
         }
      },
      {
         "uid":"3",
         "eth":{
            "eth_dst":"FF:FF:FF:FF:FF:FF",
            "eth_src":"00:1E:0B:AE:D3:BE",
            "eth_type":"0x0800(IPv4)"
         },
         "ip":{
            "ipv4_dst":"10.0.100.102",
            "ipv4_src":"10.0.100.101",
            "ip_proto":"ICMP",
            "ip_dscn":"CS0",
            "ip_scn":"NOT_ECT"
         },
         "icmp":{
            "icmp_type_code":"ECHO_REQ"
         }
      },
      {
         "uid":"4",
         "eth":{
            "eth_dst":"FF:FF:FF:FF:FF:FF",
            "eth_src":"00:1E:0B:AE:D3:BE",
            "eth_type":"0x0800(IPv4)"
         },
         "ip":{
            "ipv4_dst":"10.0.100.102",
            "ipv4_src":"10.0.100.101",
            "ip_proto":"UDP",
            "ip_dscn":"CS0",
            "ip_scn":"NOT_ECT"
         },
         "udp":{
            "udp_src":68,
            "udp_dst":67
         },
         "dhcp":{
            "opcode":"BOOT_REQ",
            "boot_flags":"BROADCAST",
            "client_ip":"0.0.0.0",
            "your_client_ip":"0.0.0.0",
            "next_server_ip":"0.0.0.0",
            "relay_agent_ip":"0.0.0.0",
            "client_mac":"00:1E:0B:AE:D3:BE",
            "options":[
               {
                  "type":"DISCOVER"
               },
               {
                  "parameter_request_list":[
                     "SUBNET_MASK",
                     "HOST_NAME"
                  ]
               }
            ]
         }
      }
   ]
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Create a packet

Sample Request 

POST /sdn/v2.0/diag/packets

{
   "packet":{
      "type":"UDP",
      "eth":{
         "eth_src":"01:01:01:01:01:01",
         "eth_dst":"02:02:02:02:02:02",
         "eth_type":"IPv4",
         "vlan_vid":"100",
         "vlan_priority":"PRIORITY_5"
      },
      "ip":{
         "ipv4_dst":"10.0.100.102",
         "ipv4_src":"10.0.100.101",
         "ip_proto":"UDP",
         "ip_dscn":"CS0",
         "ip_scn":"NOT_ECT"
      },
      "udp":{
         "udp_dst":152,
         "udp_src":12345
      }
   }
}

Sample Response Body 

{
   "packet":{
      "uid":"2",
      "eth":{
         "eth_src":"01:01:01:01:01:01",
         "eth_dst":"02:02:02:02:02:02",
         "eth_type":"0x0800(IPv4)",
         "vlan_vid":"100",
         "vlan_priority":"PRIORITY_5"
      },
      "ip":{
         "ipv4_dst":"10.0.100.102",
         "ipv4_src":"10.0.100.101",
         "ip_proto":"UDP",
         "ip_dscn":"CS0",
         "ip_scn":"NOT_ECT"
      },
      "udp":{
         "udp_dst":152,
         "udp_src":12345
      }
   }
}

Response codes 

  • Normal: Created (201)

  • Error: Bad Request (400), Unauthorized (401), Service Unavailable (503)

Diag/packets/{packet uid}

List a packet

Sample request 

List the packet with the specified packet identifier:

GET /sdn/v2.0/diag/packets/2

There is no request body for this API.

Sample response 

{
   "packet":{
      "uid":"2",
      "eth":{
         "eth_src":"01:01:01:01:01:01",
         "eth_dst":"02:02:02:02:02:02",
         "eth_type":"0x0800(IPv4)",
         "vlan_vid":"100",
         "vlan_priority":"PRIORITY_5"
      },
      "ip":{
         "ipv4_dst":"10.0.100.102",
         "ipv4_src":"10.0.100.101",
         "ip_proto":"UDP",
         "ip_dscn":"CS0",
         "ip_scn":"NOT_ECT"
      },
      "udp":{
         "udp_dst":152,
         "udp_src":12345
      }
   }
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Delete a packet

Sample request 

Delete a packet with the given packet identifier:

DELETE /sdn/v2.0/diag/packets/3

There is no request body.

Sample response 

There is no response body.

Response codes 

  • Normal: No Content (204)

  • Error: Unauthorized (401), Service Unavailable (503)

Diag/packets/{packet uid}/path

List the expected ordered path links that the packet shall take through the network

Sample request 

List the expected ordered path links based on the specified packet identifier:

GET /sdn/v2.0/diag/packets/2/path

There is no request body for this API.

Sample response 

The starting switch is identified by the source mac address of the packet.

The ending switch is identified by the destination mac address of the packet.

{
   "links":[
      {
         "src_dpid":"00:00:00:00:00:00:00:01",
         "src_port":"1",
         "dst_port":"1",
         "dst_dpid":"00:00:00:00:00:00:00:03"
      },
      {
         "src_dpid":"00:00:00:00:00:00:00:03",
         "src_port":"3",
         "dst_port":"3",
         "dst_dpid":"00:00:00:00:00:00:00:05"
      },
      {
         "src_dpid":"00:00:00:00:00:00:00:05",
         "src_port":"5",
         "dst_port":"5",
         "dst_dpid":"00:00:00:00:00:00:00:07"
      },
      {
         "src_dpid":"00:00:00:00:00:00:00:07",
         "src_port":"7",
         "dst_port":"7",
         "dst_dpid":"00:00:00:00:00:00:00:13"
      },
      {
         "src_dpid":"00:00:00:00:00:00:00:13",
         "src_port":"13",
         "dst_port":"0",
         "dst_dpid":"00:00:00:00:00:00:00:13"
      }
   ]
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Diag/packets/{packet uid}/nexthops

Get the next hop switch of the specified switch based on the packet identifier

Sample request 

Get the next hop based on the packet identifier and the data path identifier:

GET /sdn/v2.0/diag/packets/1/nexthop?src_dpid="00:00:00:00:00:00:00:01"

There is no request body for this API.

Sample response 

 {
   "nexthop":{
      "dpid":"00:00:00:00:00:00:00:03",
      "port":"3"
   }
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Diag/packets{packet uid}/action

Simulate a packet

Sample request 

Simulate a packet with the given packet identifier onto the network:

POST /sdn/v2.0/diag/packets/3/action

Sample request body:

  • Use default which requires no request body. This means to simulate the packet at the switch the host connects to

  • Specify a json request to start simulation at a specific switch

{
   "simulation":{
      "dpid":"00:00:00:00:00:00:00:01",
      "out_port":"2"
   }
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)