Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(pipelined): datapath refactor inout #12495

Merged
merged 6 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/readmes/lte/pipelined.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Pipelined services are implemented as Ryu applications (controllers) under the h

### Static Services

Static services include mandatory services (such as OAI and inout) which are always enabled, and services with a set table number. Static services can be configured in the YAML config.
Static services include mandatory services (such as OAI, ingress, middle and egress) which are always enabled, and services with a set table number. Static services can be configured in the YAML config.

```text
GTP port Local Port
Expand All @@ -55,7 +55,7 @@ Static services include mandatory services (such as OAI and inout) which are alw
V
-------------------------------
| Table 1 (PHYSICAL) |
| inout |
| ingress |
|- sets direction bit |
-------------------------------
|
Expand Down Expand Up @@ -85,7 +85,7 @@ Static services include mandatory services (such as OAI and inout) which are alw
V
-------------------------------
| Table 10 (SPECIAL) |
| inout |
| middle |
|- Forwards uplink traffic to |
| LOCAL port |
|- Forwards downlink traffic |
Expand All @@ -99,7 +99,7 @@ Static services include mandatory services (such as OAI and inout) which are alw
V
-------------------------------
| Table 20 (SPECIAL) |
| inout |
| egress |
|- Forwards uplink traffic to |
| LOCAL port |
|- Forwards downlink traffic |
Expand Down Expand Up @@ -162,15 +162,15 @@ Register | Type | Use | Set by
metadata | Write-once | Stores IMSI | Table 0 (GTP application)
reg0 | Scratch | Temporary Arithmetic | Any
reg3 | Scratch | Temporary Arithmetic | Any
reg1 | Global | Direction bit | Table 1 (inout application)
reg1 | Global | Direction bit | Table 1 (ingress app)
reg2 | Local | Policy number | Enforcement app
reg10 | Global | App ID | DPI app
reg4 | Local | Policy version number| Enforcement app
reg6 | Global | Passthrough flag | Ue Mac app
reg7 | Local | Vlan Tag | Vlan learn app
reg8 | Global | Tunnel port | MME
reg9 | Global | Tunnel ID | MME
reg10 | Local | Proxy Tag | HE
reg12 | Local | Proxy Tag | HE
reg11 | Local | Session ID | 5G stats

### Resilience
Expand All @@ -185,7 +185,7 @@ This is achieved by:
This works because ovs secure fail mode doesn't remove flows whenever the controller disconnects.

Note:
Currently we reinsert some flows instead of doing the diff logic on them(f.e. enforcement redirection flows as they need async dhcp request resolution, other tables that don't hold and session data(inout, ue_mac, etc.) but this will be added later).
Currently we reinsert some flows instead of doing the diff logic on them(f.e. enforcement redirection flows as they need async dhcp request resolution, other tables that don't hold and session data(ingress, middle, egress, ue_mac, etc.) but this will be added later).

## Testing

Expand Down
5 changes: 5 additions & 0 deletions lte/gateway/python/magma/pipelined/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,8 @@ py_library(
srcs = ["tunnel_id_store.py"],
deps = ["//orc8r/gateway/python/magma/common/redis:client"],
)

py_library(
name = "vlan_utils",
srcs = ["vlan_utils.py"],
)
13 changes: 8 additions & 5 deletions lte/gateway/python/magma/pipelined/app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ py_library(
srcs = ["classifier.py"],
deps = [
":base",
":inout",
":mandatory_apps",
"//orc8r/gateway/python/magma/common:rpc_utils",
"//orc8r/gateway/python/magma/common:sentry",
requirement("grpcio"),
Expand Down Expand Up @@ -88,7 +88,7 @@ py_library(
deps = [
":base",
":enforcement_stats",
":inout",
":mandatory_apps",
"//lte/gateway/python/magma/pipelined:redirect",
"//lte/gateway/python/magma/pipelined/qos:qos_meter_impl",
],
Expand Down Expand Up @@ -158,8 +158,8 @@ py_library(
name = "ue_mac",
srcs = ["ue_mac.py"],
deps = [
":inout",
":ipfix",
":mandatory_apps",
"//lte/gateway/python/magma/pipelined:directoryd_client",
],
)
Expand All @@ -180,17 +180,20 @@ py_library(
)

py_library(
name = "inout",
name = "mandatory_apps",
srcs = [
"inout.py",
"egress.py",
"ingress.py",
"li_mirror.py",
"middle.py",
],
deps = [
":base",
":restart_mixin",
"//lte/gateway/python/magma/pipelined:imsi",
"//lte/gateway/python/magma/pipelined:mobilityd_client",
"//lte/gateway/python/magma/pipelined:utils",
"//lte/gateway/python/magma/pipelined:vlan_utils",
"//lte/gateway/python/magma/pipelined/openflow:flows",
"//orc8r/gateway/python/magma/configuration:mconfig_managers",
requirement("scapy"),
Expand Down
3 changes: 2 additions & 1 deletion lte/gateway/python/magma/pipelined/app/check_quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
import netifaces
from lte.protos.pipelined_pb2 import SetupFlowsResult, SubscriberQuotaUpdate
from magma.pipelined.app.base import ControllerType, MagmaController
from magma.pipelined.app.inout import EGRESS, INGRESS
from magma.pipelined.app.egress import EGRESS
from magma.pipelined.app.ingress import INGRESS
from magma.pipelined.app.ue_mac import UEMacAddressController
from magma.pipelined.imsi import encode_imsi
from magma.pipelined.openflow import flows
Expand Down
2 changes: 1 addition & 1 deletion lte/gateway/python/magma/pipelined/app/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from magma.common.rpc_utils import indicates_connection_error
from magma.common.sentry import EXCLUDE_FROM_ERROR_MONITORING
from magma.pipelined.app.base import ControllerType, MagmaController
from magma.pipelined.app.inout import INGRESS
from magma.pipelined.app.ingress import INGRESS
from magma.pipelined.imsi import encode_imsi
from magma.pipelined.openflow import flows, messages
from magma.pipelined.openflow.magma_match import MagmaMatch
Expand Down