opennetworkinglab / ngsdn-tutorial

Hands-on tutorial to learn the building blocks of the Next-Gen SDN architecture
https://www.opennetworking.org/ng-sdn/
Apache License 2.0
317 stars 186 forks source link

Why cant we have GTP-U decap enabled in this tutorial? #97

Closed swapniil closed 2 years ago

swapniil commented 2 years ago

To checkout end to end flow using the tutorial simulation we need to offload both up-link and down-link packets to be handled on the leafs. I tried to simulate it using the onos commands but it is not working at all. The docker images are not accepting the changes made to the P4 code base and app builds.

The onos controller is not accepting the flow rule post API for "type" : "GTP_IPV4_DST"

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
   "flows": [ \ 
     { \ 
       "deviceId": "device:leaf2", \ 
       "tableId": "FabricIngress.spgw_ingress.s1u_filter_table", \ 
       "priority": 10, \ 
       "timeout": 0, \ 
       "isPermanent": true, \ 
       "selector": { \ 
         "criteria": [ \ 
           { \ 
             "type": "GTP_IPV4_DST", \ 
             "ip": "10.0.100.1/32" \ 
           } \ 
        ] \ 
       } \ 
     } \ 
   ] \ 
 } \ 
 ' 'http://127.0.0.1:8181/onos/v1/flows?appId=rest-api'
{"code":400,"message":"Type GTP_IPV4_DST is unknown"} 

If we push the flow "FabricIngress.spgw_ingress.s1u_filter_table" with "type" : "IPV4_DST" then onos controller accpts the API but the rule will be in PENDING status as this table requires "type": "GTP_IPV4_DST"

onos       | 13:40:19.375 WARN  [P4RuntimeFlowRuleProgrammable] Unable to translate flow rule for pipeconf 'org.onosproject.pipelines.fabric-spgw': No value found for required match field 'gtp_ipv4_dst' [DefaultFlowEntry{rule=DefaultFlowEntry{id=c200007f72e728, deviceId=device:leaf2, priority=10, selector=[IPV4_DST:10.0.100.1/32], treatment=DefaultTrafficTreatment{immediate=[NOACTION], deferred=[], transition=None, meter=[], cleared=false, StatTrigger=null, metadata=null}, tableId=FabricIngress.spgw_ingress.s1u_filter_table, created=1648732763160}, state=PENDING_ADD, life=0, liveType=UNKNOWN, packets=0, bytes=0, errCode=-1, errType=-1, lastSeen=1648732763160}]

Can someone please update how can we change the builds to support up-link and down-link path in this simulation.

swapniil commented 2 years ago

Creating an image of onos controller to support P4 runtime configuration we need to build source code with latest changes of supporting GTP Offload capability end to end.

NG-SDN Tutorial code base to create simulation: $ git clone https://github.com/opennetworkinglab/ngsdn-tutorial.git --branch advanced

NG-SDN to support GTP-Offload end to end:

Apply the code change patch on the source attached in the ticket.

  $ cd ngsdn-tutorial
  $ git apply ngsdn-tutorial-Patch-Enable-GTPDecap.txt

ONOS Controller code changes to support GTP-Offload in NG-SDN: $ git clone https://gerrit.onosproject.org/onos $ cd onos $ git checkout 2.2.2 $ git apply ONOS-Patch-Enable-GTPDecap.txt

Create build environment for onos controller image creation from source code:

Creating/Updating Images to build ONOS controller:

$ cd  build-image
$ mkdir img_create
$ cd img_create

# Create openjdk build image:
$ cp ../Dockerfile.openjdk-package-ready Dockerfile
$ docker image build -t azul/zulu-openjdk-ready:11 .
$ cd ..

# Create Bazel Image
$ cd img_create
$ cp ../Dockerfile.BazleImage Dockerfile
$ docker image build -t onosproject/bazel:2.2.2 .
$ cd ..

Once images are built we can start build process of onos-controller:

$ cd onos $ bash build-image.sh

The final outcome of this process will be a docker image with name:tag as below:

onosproject/onos-gtp:2.2.2

Can check this using docker image ls command on host.

Now we are ready to create the mininet topology of GTP-Offload:

Go to NG-SDN code repo and run off-netconfig.sh

$ cd ngsdn-tutorial $ bash off-netconfig.sh

Validation of the simulation that it is handling the packet flow in GTPU:

Checkout the image GTP-Offload-Topology.JPG in the ticket to understand topology.

Run util/mn-cmd ue ping 10.0.200.

image

ONOS-Patch-Enable-GTPDecap.txt ngsdn-tutorial-Patch-Enable-GTPDecap.txt 1