Verified Commit fd6ed460 authored by Rohan's avatar Rohan
Browse files

code clean

parent 3d358dd2
......@@ -37,7 +37,7 @@ RUN apt update && \
# Some GIT configuration commands quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
#RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
......@@ -67,7 +67,7 @@ RUN make install-dep build-release -C vpp
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as vpp-upf
FROM ubuntu:bionic as vpp-upg
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
RUN apt-get update && \
......
......@@ -68,8 +68,8 @@ RUN wget http://repo.openfusion.net/centos7-x86_64/hyperscan-devel-5.3.0-1.of.el
http://repo.openfusion.net/centos7-x86_64/hyperscan-5.3.0-1.of.el7.x86_64.rpm \
&& rpm -i *.rpm
WORKDIR /vpp-upg
COPY scripts/ /vpp-upg/scripts
WORKDIR /vpp-upf
COPY scripts/ /vpp-upf/scripts
# Applying vpp patches
RUN git clone -b stable/2101 https://github.com/fdio/vpp.git && \
......@@ -105,29 +105,29 @@ RUN wget http://repo.openfusion.net/centos7-x86_64/hyperscan-devel-5.3.0-1.of.el
http://repo.openfusion.net/centos7-x86_64/hyperscan-5.3.0-1.of.el7.x86_64.rpm \
&& rpm -i *.rpm && rm *.rpm && yum remove -y wget
WORKDIR /openair-upg/bin/
COPY --from=vpp-upg-builder /vpp-upg/scripts/entrypoint.sh /openair-upg/bin/entrypoint.sh
COPY --from=vpp-upg-builder /vpp-upg/vpp/build-root/install-vpp-native/vpp/bin/vpp .
COPY --from=vpp-upg-builder /vpp-upg/vpp/build-root/install-vpp-native/vpp/bin/vppctl .
WORKDIR /openair-upf/bin
COPY --from=vpp-upg-builder /vpp-upf/scripts/entrypoint.sh .
COPY --from=vpp-upg-builder /vpp-upf/vpp/build-root/install-vpp-native/vpp/bin/vpp .
COPY --from=vpp-upg-builder /vpp-upf/vpp/build-root/install-vpp-native/vpp/bin/vppctl .
WORKDIR /openair-upg/etc
COPY --from=vpp-upg-builder /vpp-upg/scripts/upg_conf/init.conf /openair-upg/etc/init.conf
COPY --from=vpp-upg-builder /vpp-upg/scripts/upg_conf/startup_debug.conf /openair-upg/etc/startup_debug.conf
WORKDIR /openair-upf/etc
COPY --from=vpp-upg-builder /vpp-upf/scripts/upg_conf/init.conf .
COPY --from=vpp-upg-builder /vpp-upf/scripts/upg_conf/startup_debug.conf .
WORKDIR /usr/lib64
COPY --from=vpp-upg-builder /vpp-upg/vpp/build-root/install-vpp-native/vpp/lib/ .
COPY --from=vpp-upg-builder /vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/ .
RUN ldconfig
RUN groupadd vpp
WORKDIR /vpp-upg/
COPY --from=vpp-upg-builder /vpp-upg/scripts/run.sh /openair-upg/run.sh
WORKDIR /openair-upf
COPY --from=vpp-upg-builder /vpp-upg/scripts/run.sh .
#expose
EXPOSE 8085/udp 2152/udp
ENTRYPOINT ["/openair-upg/bin/entrypoint.sh"]
CMD ["/openair-upg/run.sh"]
CMD ["/openair-upf/run.sh"]
......@@ -5,7 +5,7 @@ $ git clone https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-upf-vpp.git
$ cd oai-cn5g-upf-vpp
$ git checkout develop
$ git checkout vpp-upf
```
# 2. Generic Parameters #
......@@ -19,7 +19,7 @@ Here in our network configuration, we need to pass the "GIT PROXY" configuration
## 3.1 On a Ubuntu 18.04 Host ##
```bash
$ docker build --target vpp-upf --tag vpp-upf:develop \
$ docker build --target vpp-upg --tag vpp-upg:develop \
--file docker/Dockerfile.ubuntu.18.04 \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" .
```
......@@ -27,7 +27,7 @@ $ docker build --target vpp-upf --tag vpp-upf:develop \
## 3.2 On a RHEL 7 Host ##
```bash
$ docker build --target vpp-upg --tag vpp-upf:develop \
$ docker build --target vpp-upg --tag vpp-upg:develop \
--file docker/Dockerfile.vppupf.rhel7 \
--build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" .
```
......@@ -19,4 +19,3 @@
3. [Building the Docker Image](./BUILD_IMAGE.md)
4. [About network configuration](./VPP_NETWORKING.md)
5. [About VPP-UPF configuration](./VPP_UPF_CONFIG.md)
6. [Development guidelines for VPP-UPF](./DEVELOPMENT_GUIDELINE.md)
......@@ -28,12 +28,3 @@ ubuntu@test-upf:~/oai-cn5g-upf-vpp/build/scripts$ ./build_vpp_upf -I -f
```bash
ubuntu@test-upf:~/oai-cn5g-upf-vpp/build/scripts$ ./build_vpp_upf -c -V -b Debug
```
### Configure VPP-UPF
Refer this page for [VPP-UPF configuration](./VPP_UPF_CONFIG.md)
### Launch VPP-UPF
```bash
ubuntu@test-upf:~$ cd oai-cn5g-upf-vpp/vpp
ubuntu@test-upf:~/oai-cn5g-upf-vpp/vpp$ ./run.sh
```
......@@ -8,6 +8,7 @@ Here I have three interfaces to docker container. We rename them just for sec of
additional route added for UE traffic 10.10.10.0/24 network <br/>
<br/>
<br/>
```bash
ip link set eth0 down
ip link set eth0 name access
......
......@@ -9,39 +9,41 @@ Below is sample vpp-upf configuration. We use at lease three veth-pairs as UPF i
ip table add 1
ip table add 2
####### Create N4 interface
create host-interface name core
set interface mac address host-core 00:0c:29:46:1f:54
set interface mtu 1500 host-core
set interface ip table host-core 0
set interface ip address host-core 192.168.61.201/26
set interface state host-core up
####### Create N3 interface
create host-interface name access
set interface mac address host-access 00:0c:29:46:1f:55
set interface mtu 1500 host-access
set interface ip table host-access 1
set interface ip address host-access 192.168.62.201/26
set interface state host-access up
####### Create N6 interface
create host-interface name sgi
set interface mac address host-sgi 00:0c:29:46:1f:53
set interface mtu 1500 host-sgi
set interface ip table host-sgi 2
set interface ip address host-sgi 192.168.63.201/26
set interface state host-sgi up
####### Add ip routes
ip route add 0.0.0.0/0 table 0 via 192.168.61.196 host-core
ip route add 0.0.0.0/0 table 1 via 192.168.62.210 host-access
ip route add 0.0.0.0/0 table 2 via 192.168.63.194 host-sgi
####### Configure PFCP enpoint
upf pfcp endpoint ip 192.168.61.201 vrf 0
####### Add network instance
upf nwi name core vrf 0
upf nwi name access vrf 1
upf nwi name sgi vrf 2
####### Add fqdn
upf node-id fqdn gwu1.vpp.upg.node.epc.mnc095.mcc208.3gppnetwork.org
####### Specify release for TS 3GPP 29.244 (15 or 16)
upf specification release 16
trace add af-packet-input 100
......
......@@ -44,24 +44,21 @@ done
# Near future we will have multiple interfaces (e.g. two n6 interface for edge computing case)
# We define in this order in docker-compose -> it is alphabetical order
#
SGI_IPV4=$(ifconfig $INTERFACE_SGI | grep "inet " | awk '{print $2}')
SGI_IPV4=$(ifconfig eth2 | grep "inet " | awk '{print $2}')
UE_DL_Gw=$SGI_IPV4
ip link set eth0 down
ip link set eth0 name access
ip link set $INTERFACE_ACCESS down
ip link set $INTERFACE_ACCESS name access
ip link set access up
ip link set eth1 down
ip link set eth1 name core
ip link set $INTERFACE_CORE down
ip link set $INTERFACE_CORE name core
ip link set core up
ip link set eth2 down
ip link set eth2 name sgi
ip link set $INTERFACE_SGI down
ip link set $INTERFACE_SGI name sgi
ip link set sgi up
ip route add $NETWORK_UE_IP via $UE_DL_Gw dev sgi
ip route add $NETWORK_UE_IP via $SGI_IPV4 dev sgi
echo "Done setting the configuration"
......
--- a/Makefile 2021-04-30 14:53:42.462488110 +0200
+++ b/Makefile 2021-04-30 14:50:53.189155910 +0200
@@ -279,9 +279,9 @@
else ifneq ("$(wildcard /etc/redhat-release)","")
ifeq ($(OS_ID),rhel)
@sudo -E yum-config-manager --enable rhel-server-rhscl-7-rpms
- @sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
- @sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
- @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
+ @sudo -E yum groupinstall -y $(RPM_DEPENDS_GROUPS)
+ @sudo -E yum install -y $(RPM_DEPENDS)
+ @sudo -E debuginfo-install -y glibc openssl-libs mbedtls-devel zlib
else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
@sudo -E dnf install $(CONFIRM) dnf-plugins-core epel-release
@sudo -E dnf config-manager --set-enabled \
<?xml version="1.0" encoding="UTF-8"?>
<dst:devsol xmlns:dst="http://www.developingsolutions.com/schema/dsTest" test_name="Local Library/upf_test_multiple_ue.dsx">
<!-- XML generated by dsClientv5.5.20201109 on 02/24/2021 11:11:24 using dsTest schema v5.5.20210117 -->
<config>
<nodes>
<spr name="spr_gnb">
<auto_start>true</auto_start>
<subscriber_database count="2" name="gnb_subs">
<subscriber_profiles>
<access_profile name="access_profile">
<new_radio_128_nea0_encryption>true</new_radio_128_nea0_encryption>
<new_radio_128_nia1_integrity>true</new_radio_128_nia1_integrity>
<requested_nssai>
<s_nssai>
<sst>222</sst>
<sd>123</sd>
</s_nssai>
<s_nssai>
<sst>75</sst>
<sd>2</sd>
</s_nssai>
</requested_nssai>
<ssc_mode>1</ssc_mode>
</access_profile>
<subscription_profile name="subscription_profile">
<pdu_config>
<context_id>34</context_id>
<type>IPv4</type>
<dnn>default</dnn>
<s_nssai>
<sst>222</sst>
<sd>123</sd>
</s_nssai>
<up_transport_address>172.10.5.1</up_transport_address>
</pdu_config>
</subscription_profile>
<user_data_profile name="user_data_profile_1">
<delay>500</delay>
<basic_data name="basic_data">
<dest_ip>8.8.8.8</dest_ip>
<protocol>UDP</protocol>
<dport>5001</dport>
<sport>5001</sport>
<size>1024</size>
<rate>10</rate>
<auto_start>true</auto_start>
<auto_stop>5000</auto_stop>
</basic_data>
</user_data_profile>
<SmartProfile name="SmartProfile">
<SmartEvents>
<states>
<state start_point="133.6,81.6" width="100.0" height="60.0">idle</state>
<state start_point="366.1,81.6" width="100.0" height="60.0">pdu_setup</state>
<state start_point="510.1,193.6" width="100.0" height="60.0">pdu_delete</state>
<state start_point="381.6,337.6" width="100.0" height="60.0">detach</state>
<state start_point="157.6,341.6" width="100.0" height="60.0">ending</state>
</states>
<event_handlers>
<event_handler start_point="144.1,82.1" end_point="224.1,82.1" height="-68">
<current_state>idle</current_state>
<transaction_start/>
<action>
<app>n2</app>
<event>registration</event>
<node>gnb_1</node>
</action>
</event_handler>
<event_handler start_point="234.1,112.1" end_point="366.6,112.1" height="-92">
<current_state>idle</current_state>
<event_received app="n2" event="registration"/>
<next_state>pdu_setup</next_state>
<timer>2000</timer>
</event_handler>
<event_handler start_point="376.6,82.1" end_point="456.6,82.1" height="-92">
<current_state>pdu_setup</current_state>
<timeout/>
<action>
<app>n2</app>
<event>pdu_session_establish</event>
<node>gnb_1</node>
<dnn>carrier.com</dnn>
</action>
</event_handler>
<event_handler start_point="466.6,112.1" end_point="560.6,194.1" height="-72">
<current_state>pdu_setup</current_state>
<event_received app="n2" event="pdu_session_establish"/>
<next_state>pdu_delete</next_state>
<timer>500000000</timer>
</event_handler>
<event_handler start_point="610.6,204.1" end_point="610.6,244.1" height="68">
<current_state>pdu_delete</current_state>
<timeout/>
<action>
<app>n2</app>
<event>pdu_session_release</event>
<node>gnb_1</node>
<dnn>default</dnn>
</action>
</event_handler>
<event_handler start_point="560.6,254.1" end_point="482.1,368.1" height="-92">
<current_state>pdu_delete</current_state>
<event_received app="n2" event="pdu_session_release"/>
<next_state>detach</next_state>
<timer>2000</timer>
</event_handler>
<event_handler start_point="382.1,368.1" end_point="258.1,372.1" height="-68">
<current_state>detach</current_state>
<timeout/>
<action>
<app>n2</app>
<event>deregistration</event>
<node>gnb_1</node>
</action>
<next_state>ending</next_state>
</event_handler>
<event_handler start_point="208.1,342.1" end_point="184.1,142.1" height="-52">
<current_state>ending</current_state>
<event_received app="n2" event="deregistration"/>
<transaction_complete/>
</event_handler>
<event_handler start_point="109.4,279.0" end_point="134.1,132.1" height="-72">
<current_state>ANY</current_state>
<error/>
<transaction_failed/>
</event_handler>
</event_handlers>
</SmartEvents>
</SmartProfile>
</subscriber_profiles>
<subscriber_group start="1" end="2" name="subscriber_group">
<group_profiles>
<access_profile>access_profile</access_profile>
<subscription_profile>subscription_profile</subscription_profile>
<user_data_profile>user_data_profile_1</user_data_profile>
<SmartProfile>SmartProfile</SmartProfile>
</group_profiles>
<identities>
<imsi>208950000000031</imsi>
<imei>55000000000001</imei>
<key>0x0C0A34601D4F07677303652C0462535B</key>
<opc>0x63bfa50ee6523365ff14c1f45f88737d</opc>
</identities>
<dynamic_information>
<sqn>0x40</sqn>
<vplmn>431-265</vplmn>
<cell_id>1485</cell_id>
</dynamic_information>
</subscriber_group>
</subscriber_database>
</spr>
<gnb name="gnb_1">
<auto_start>true</auto_start>
<n2>
<interface name="interface_1" native="true">
<sctp>
<ip_address>192.168.61.193</ip_address>
<dest_ip_address>192.168.61.195</dest_ip_address>
</sctp>
<user_socket>
<ip_address>192.168.61.193</ip_address>
</user_socket>
</interface>
<user_data>
<basic_data name="basic_data"/>
</user_data>
</n2>
<mcc>208</mcc>
<mnc>95</mnc>
<node_name>gnb-1</node_name>
<global_gnb_id>1048575</global_gnb_id>
<default_paging_drx>v32</default_paging_drx>
<supported_ta>
<tac>0xa000</tac>
<bplmn>
<mcc>208</mcc>
<mnc>95</mnc>
<slice_support_item>
<nssai_sst>222</nssai_sst>
<nssai_sd>123</nssai_sd>
</slice_support_item>
<slice_support_item>
<nssai_sst>0x27</nssai_sst>
<nssai_sd>0x385382</nssai_sd>
</slice_support_item>
</bplmn>
<bplmn>
<mcc>207</mcc>
<mnc>54</mnc>
<slice_support_item>
<nssai_sst>0x10</nssai_sst>
<nssai_sd>0x583922</nssai_sd>
</slice_support_item>
</bplmn>
</supported_ta>
<supported_ta>
<tac>0xa001</tac>
<bplmn>
<mcc>202</mcc>
<mnc>100</mnc>
<slice_support_item>
<nssai_sst>0x23</nssai_sst>
<nssai_sd>0x321236</nssai_sd>
</slice_support_item>
</bplmn>
<bplmn>
<mcc>203</mcc>
<mnc>001</mnc>
<slice_support_item>
<nssai_sst>0xFF</nssai_sst>
<nssai_sd>0x123483</nssai_sd>
</slice_support_item>
</bplmn>
</supported_ta>
<subscriber_database name="gnb_subs"/>
</gnb>
</nodes>
</config>
<command>
<wait>1000</wait>
</command>
<command>
<spr name="spr_gnb">
<action>
<rate>1</rate>
<cycle>1</cycle>
<start>1</start>
<end>2</end>
<ready>gnb_1</ready>
<app>SmartEvents</app>
<event>start</event>
</action>
</spr>
</command>
</dst:devsol>
<?xml version="1.0" encoding="UTF-8"?>
<dst:devsol xmlns:dst="http://www.developingsolutions.com/schema/dsTest" test_name="Local Library/upf_test_multiple_ue.dsx">
<!-- XML generated by dsClientv5.5.20201109 on 02/24/2021 11:11:24 using dsTest schema v5.5.20210117 -->
<config>
<nodes>
<spr name="spr_gnb">
<auto_start>true</auto_start>
<subscriber_database count="2" name="gnb_subs">
<subscriber_profiles>
<access_profile name="access_profile">
<new_radio_128_nea0_encryption>true</new_radio_128_nea0_encryption>
<new_radio_128_nia1_integrity>true</new_radio_128_nia1_integrity>
<requested_nssai>
<s_nssai>
<sst>222</sst>
<sd>123</sd>
</s_nssai>
<s_nssai>
<sst>75</sst>
<sd>2</sd>
</s_nssai>
</requested_nssai>
<ssc_mode>1</ssc_mode>
</access_profile>
<subscription_profile name="subscription_profile">
<pdu_config>
<context_id>34</context_id>
<type>IPv4</type>
<dnn>default</dnn>
<s_nssai>
<sst>222</sst>
<sd>123</sd>
</s_nssai>
<up_transport_address>172.10.5.1</up_transport_address>
</pdu_config>
</subscription_profile>
<user_data_profile name="user_data_profile_1">
<delay>500</delay>
<basic_data name="basic_data">
<dest_ip>8.8.8.8</dest_ip>
<protocol>UDP</protocol>
<dport>5001</dport>
<sport>5001</sport>
<size>1024</size>
<rate>10</rate>
<auto_start>true</auto_start>
<auto_stop>5000</auto_stop>
</basic_data>
</user_data_profile>
<SmartProfile name="SmartProfile">
<SmartEvents>
<states>
<state start_point="133.6,81.6" width="100.0" height="60.0">idle</state>
<state start_point="366.1,81.6" width="100.0" height="60.0">pdu_setup</state>
<state start_point="510.1,193.6" width="100.0" height="60.0">pdu_delete</state>
<state start_point="381.6,337.6" width="100.0" height="60.0">detach</state>
<state start_point="157.6,341.6" width="100.0" height="60.0">ending</state>
</states>
<event_handlers>
<event_handler start_point="144.1,82.1" end_point="224.1,82.1" height="-68">
<current_state>idle</current_state>
<transaction_start/>
<action>
<app>n2</app>
<event>registration</event>
<node>gnb_1</node>
</action>
</event_handler>
<event_handler start_point="234.1,112.1" end_point="366.6,112.1" height="-92">
<current_state>idle</current_state>
<event_received app="n2" event="registration"/>
<next_state>pdu_setup</next_state>
<timer>2000</timer>
</event_handler>
<event_handler start_point="376.6,82.1" end_point="456.6,82.1" height="-92">
<current_state>pdu_setup</current_state>
<timeout/>
<action>
<app>n2</app>
<event>pdu_session_establish</event>
<node>gnb_1</node>
<dnn>carrier.com</dnn>
</action>
</event_handler>
<event_handler start_point="466.6,112.1" end_point="560.6,194.1" height="-72">
<current_state>pdu_setup</current_state>
<event_received app="n2" event="pdu_session_establish"/>
<next_state>pdu_delete</next_state>
<timer>500000000</timer>
</event_handler>
<event_handler start_point="610.6,204.1" end_point="610.6,244.1" height="68">
<current_state>pdu_delete</current_state>
<timeout/>
<action>
<app>n2</app>
<event>pdu_session_release</event>
<node>gnb_1</node>
<dnn>default</dnn>
</action>
</event_handler>
<event_handler start_point="560.6,254.1" end_point="482.1,368.1" height="-92">
<current_state>pdu_delete</current_state>
<event_received app="n2" event="pdu_session_release"/>
<next_state>detach</next_state>
<timer>2000</timer>
</event_handler>
<event_handler start_point="382.1,368.1" end_point="258.1,372.1" height="-68">
<current_state>detach</current_state>
<timeout/>
<action>
<app>n2</app>
<event>deregistration</event>
<node>gnb_1</node>
</action>
<next_state>ending</next_state>
</event_handler>
<event_handler start_point="208.1,342.1" end_point="184.1,142.1" height="-52">
<current_state>ending</current_state>
<event_received app="n2" event="deregistration"/>
<transaction_complete/>
</event_handler>
<event_handler start_point="109.4,279.0" end_point="134.1,132.1" height="-72">
<current_state>ANY</current_state>
<error/>
<transaction_failed/>
</event_handler>
</event_handlers>
</SmartEvents>
</SmartProfile>
</subscriber_profiles>
<subscriber_group start="1" end="2" name="subscriber_group">
<group_profiles>
<access_profile>access_profile</access_profile>
<subscription_profile>subscription_profile</subscription_profile>
<user_data_profile>user_data_profile_1</user_data_profile>
<SmartProfile>SmartProfile</SmartProfile>
</group_profiles>
<identities>
<imsi>208950000000031</imsi>
<imei>55000000000001</imei>
<key>0x0C0A34601D4F07677303652C0462535B</key>
<opc>0x63bfa50ee6523365ff14c1f45f88737d</opc>
</identities>
<dynamic_information>
<sqn>0x40</sqn>
<vplmn>431-265</vplmn>
<cell_id>1485</cell_id>
</dynamic_information>
</subscriber_group>
</subscriber_database>
</spr>
<gnb name="gnb_1">
<auto_start>true</auto_start>
<n2>
<interface name="interface_1" native="true">
<sctp>
<ip_address>192.168.61.193</ip_address>
<dest_ip_address>192.168.61.195</dest_ip_address>