Skip to content

Use network capabilities

In this tutorial you use the platform's network APIs on a simulated 5G device: you ask for a better connection for it, find where it is, and steer its traffic to an application you deployed at the edge.

  • Quality on Demand (QoD) asks the network for a stable, low-latency connection for a device, for a set time.
  • Location Retrieval tells you where a device is, as an area on the map.
  • Traffic Influence routes a device's traffic to an application instance in an edge cloud zone.

You call all three as CAMARA APIs on the Open Exposure Gateway (OEG). OEG passes each request to the Service Resource Manager (SRM), which reaches the 5G core's network exposure function (NEF) through a TF-SDK adapter. Here the 5G core is the EURECOM Core Simulator, so the device and its location are simulated.

Before you start

Use an OpenOP deployment with authentication enabled, as described in Deploy with Helm or Deploy with Ansible. The Quickstart uses dev mode with login turned off.

Complete Get API access and the EURECOM integration. Keep the UE IPv4 recorded from CoreSim's PDU Session log.

Create an API client holding the quality-on-demand, location-retrieval and traffic-influence API products, and obtain an App Provider token with these scopes:

Operation Scope
QoD quality-on-demand:sessions:create, quality-on-demand:sessions:read, quality-on-demand:sessions:delete
Location location-retrieval:read
Device Traffic Influence traffic-influence:traffic-influence-devices:write, traffic-influence:traffic-influences:read, traffic-influence:traffic-influences:delete

For Traffic Influence, keep an application instance running from Deploy your first application. The API client used here must belong to that application's App Provider. Record its appId, appInstanceId, edgeCloudZoneId and the IPv4 address of its access endpoint.

Set OEG_URL to the public OEG URL, UE_IPV4 to the CoreSim UE address, and APP_SERVER_IPV4 to the application's endpoint IP. Replace the token and address placeholders below; localhost:32263 is the kind example:

export OEG_URL=http://localhost:32263
export TOKEN='YOUR_APP_PROVIDER_ACCESS_TOKEN'
export UE_IPV4='UE_IPV4_FROM_CORESIM'
export APP_SERVER_IPV4='APPLICATION_ENDPOINT_IPV4'

1. Create and read a QoD session

Create a QoD session for ten minutes using the qos-e profile configured in the EURECOM setup:

curl --fail-with-body -sS -X POST "$OEG_URL/quality-on-demand/v1/sessions" \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  --data @- <<JSON
{
  "device": {
    "ipv4Address": {"publicAddress": "$UE_IPV4", "publicPort": 12345}
  },
  "applicationServer": {"ipv4Address": "$APP_SERVER_IPV4"},
  "qosProfile": "qos-e",
  "duration": 600
}
JSON

Expect HTTP 201 with a sessionId. Save it as SESSION_ID and read the session:

export SESSION_ID='RETURNED_SESSION_ID'
curl --fail-with-body -sS -H "Authorization: Bearer $TOKEN" \
  "$OEG_URL/quality-on-demand/v1/sessions/$SESSION_ID"

Repeat the GET request while qosStatus is REQUESTED. Continue when it becomes AVAILABLE. If it becomes UNAVAILABLE, check the response and service logs before trying again.

2. Retrieve geographic location

Retrieve the simulated device's location, accepting a fix up to 300 seconds old (maxAge):

curl --fail-with-body -sS -X POST "$OEG_URL/location-retrieval/v0.5/retrieve" \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  --data @- <<JSON
{
  "device": {
    "ipv4Address": {"publicAddress": "$UE_IPV4", "publicPort": 12345}
  },
  "maxAge": 300
}
JSON

Expect HTTP 200 with lastLocationTime and a geographic area: a CIRCLE with center/radius or a POLYGON with boundary points. With the example CoreSim profile, the coordinates should be near latitude 43.6144, longitude 7.0731.

3. Influence traffic to the deployed application

Use the application, instance and zone IDs recorded from the application tutorial. Keep that instance running with its IPv4 access endpoint. For this example, set API_CONSUMER_ID to your API client's client ID:

export APP_ID='YOUR_APPLICATION_ID'
export APP_INSTANCE_ID='YOUR_INSTANCE_ID'
export ZONE_ID='YOUR_EDGE_CLOUD_ZONE_ID'
export API_CONSUMER_ID='YOUR_API_CLIENT_ID'

curl --fail-with-body -sS -X POST \
  "$OEG_URL/traffic-influence/v0.10/traffic-influence-devices" \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  --data @- <<JSON
{
  "apiConsumerId": "$API_CONSUMER_ID",
  "appId": "$APP_ID",
  "appInstanceId": "$APP_INSTANCE_ID",
  "edgeCloudZoneId": "$ZONE_ID",
  "device": {
    "ipv4Address": {"publicAddress": "$UE_IPV4", "publicPort": 12345}
  }
}
JSON

OpenOP obtains the traffic destination from the selected application instance's access endpoint.

Expect HTTP 201 with trafficInfluenceID. Save it as TI_ID and read the resource:

export TI_ID='RETURNED_TRAFFIC_INFLUENCE_ID'
curl --fail-with-body -sS -H "Authorization: Bearer $TOKEN" \
  "$OEG_URL/traffic-influence/v0.10/traffic-influences/$TI_ID"

While state is ordered or created, repeat the GET request until it becomes active. If it becomes error, check the response and service logs before trying again.

4. Clean up

Delete the resources created by this tutorial. --include shows the HTTP status of the empty responses:

curl --include --fail-with-body -sS -X DELETE -H "Authorization: Bearer $TOKEN" \
  "$OEG_URL/traffic-influence/v0.10/traffic-influences/$TI_ID"

curl --include --fail-with-body -sS -X DELETE -H "Authorization: Bearer $TOKEN" \
  "$OEG_URL/quality-on-demand/v1/sessions/$SESSION_ID"

Expect HTTP 202 for TI deletion and 204 for QoD deletion. Repeat the earlier GET requests: TI should reach deleted or return 404, and QoD should return 404.

If you created the application solely for this exercise, complete its termination and removal steps in Deploy your first application. Location retrieval needs no public API cleanup.

What you learned

QoD and Traffic Influence create resources with identifiers and lifecycle states. Location retrieval returns a synchronous result.

Next steps

Read the Release 2 support matrix for field limits, and run the E2E lab for repeatable assertions and cleanup checks.