Truminds 5G UPF supports MPTCP Proxy














































Truminds 5G UPF supports MPTCP Proxy



In this blog, I am going to tell you about the MPTCP Proxy support for ATSSS in Truminds 5G UPF. So, first of all let’s understand some key terms quickly.

UPF stands for the User Plane Function. It is a 5G network function which routes traffic from mobile side to internet and vice versa. You can imagine that a UPF must handle packets from tens and thousands of mobiles if not more, so it is operating at scale and must be highly efficient in its processing.

ATSSS stands for Access side Traffic Steering, Switching Splitting. So, the term Access simply means the interface of the UPF towards the mobile side. I always imagine in my head that the mobile is towards the far left, UPF is in the middle and the Internet is on the right side. Something like this –

No alt text provided for this image

The interesting part begins from the fact that the Mobile really has two main data interfaces. One is the Cellular interface and the other is the Wifi interface. One can hardly imagine a mobile which will not have a Wifi interface these days. Let us also keep in mind that the Mobile is trying to reach some server on the Internet. Let us call that server as ServerOnInternet. Let us further assume that the connection between the Mobile and the ServerOnInternet is a TCP connection. So, let us imagine the below picture.

No alt text provided for this image

In normal scenarios, the TCP connection from Mobile would use either the Cellular interface or the Wifi interface. Afterall, it is one TCP connection, and one TCP connection uses one source IP address and therefore one interface on Mobile which is having that IP address. The UPF merely shunts the IP packets right and left, but the TCP connection is end-to-end between the Mobile and the ServerOnInternet

Now the above is a pity, because even though we have an additional Wifi interface on the Mobile, for the above TCP connection we are ending up using just one interface – the Cellular one in our usecase. If TCP allowed it, it would have been nice to somehow use the additional Wifi interface too to send data from there too thus fattening the pipe of data between Mobile and ServerOnInternet. Alas, TCP would not allow us to take advantage of this.

Now, while TCP does not allow to use multiple interfaces for a TCP connection, there is a protocol called MPTCP which does. That is why there is the additional MP in the MPTCP. MP stands for Multipath. As the name indicates, MPTCP allows a client machine to make multiple TCP connections towards a server which supports MPTCP. For application on the client, it is still a single connection like the TCP connection earlier. But under the hood, this MPTCP connection comprises of potentially multiple individual TCP connections between the client and the server. Since each TCP connection can use its own interface and IP address, so in simple terms, in our usecase, the mobile can make an MPTCP connection with ServerOnInternet comprising of two TCP connections – the first TCP connection will use the Cellular interface and the second TCP connection will use the Wifi interface. And voila, we have solved the problem, haven’t we ! And we did not have to do anything special at the UPF either. MPTCP clearly rocks !

But there is always a catch. And this will be no exception. The trouble is that while the latest Mobile devices meant for 5G are sure to support MPTCP, the various servers on the internet may not support MPTCP just yet. What if the server on the internet does not support MPTCP, but just supports TCP ? Well, in that case when the Mobile attempts to make an MPTCP connection to the ServerOnInternet which does not support MPTCP, the MPTCP specification has defined procedures to let the Mobile client fallback to normal TCP after detecting that the server does not support MPTCP. So we are back to square one. If most of the servers on the Internet do not support MPTCP (unfortunately that is the sad truth for the moment), then the Mobile would only be able to use just one interface for the connection to the server.

The clever 3GPP folks anticipated the above issue and came out with a solution. They said, ok we accept the fact that the servers on the internet may not support MPTCP, but the Mobile would indeed support MPTCP in 5G. Think for a moment, what solution they came up with. You can take a small pause from reading further and think how they did it. Hint, they used the UPF for this.

Alright, so what the 3GPP folks said was that the UPF would be required to support MPTCP in 5G as a feature. So now we have a situation where the Mobile supports MPTCP, the UPF supports MPTCP but the ServerOnInternet does not support MPTCP in our example usecase. So, what the Mobile would do is that it will make an MPTCP connection from itself to the UPF. Essentially the mobile would make a TCP connection over its Cellular interface and another TCP connection over the Wifi interface. These TCP connections comprising the single MPTCP connection would terminate at the UPF which also supports MPTCP. But remember that the goal of the mobile is to exchange data with the ServerOnInternet and not just with the UPF. So, the UPF makes a regular TCP connection from itself to ServerOnInternet. Now the data from Mobile comes on MPTCP to the UPF, the UPF then sends this data on TCP to ServerOnInternet. The ServerOnInternet sends data on TCP to the UPF, the UPF sends this data on MPTCP to the Mobile. This is what the MPTCP proxy on UPF does. Pretty neat ! So something like this –

No alt text provided for this image

There is still a fly in the ointment though. How does the Mobile tell the UPF what is the IP address of the ServerOnInternet it is trying to reach out to ? Recall that the Mobile is just making a bunch of TCP connections to the UPF IP Address as part of its MPTCP connection. That is where the solution in RFC 8803 comes into play. The long and short is that when the Mobile sends a TCP SYN for the first TCP connection it makes to the UPF, it sends the information about the details of the IP Address and port number it intends to reach out to for the ServerOnInternet. So now the UPF knows enough information to make the TCP connection to ServerOnInternet and then proxy the data back and forth like I explained earlier. Game set and match. Yes indeed ! the ladder diagram below from the 3GPP TS 29.244 gives a nice little overview of what happens under the hood

No alt text provided for this image

Now then, we must think of some practical issues in UPF for handling all these MPTCP and TCP connections at scale. As I mentioned earlier, there will be tens of thousands of mobiles trying to make connections to various servers on the internet. This means there will be tens and thousands of MPTCP and TCP connections to be handled at UPF. A typical UPF, as is the case with Truminds UPF, is implemented in user space with high speed I/O enabled by DPDK (Data Plane Development kit) to bypass the Linux kernel. If we do bypass the Linux kernel, then we do not have the opportunity to use the Linux TCP or MPTCP stack. We are pretty much on our own. So, the Truminds engineers recognized this and wrote a user space TCP and MPTCP stack of their own which runs in context of the worker threads of the UPF which run on the various CPU cores of the machine where UPF is running. Implementing a TCP stack and then MPTCP on top of it is a daunting task, but Truminds engineers did it. The stack itself is generic so if you are building your own UPF and want a similar usecase to be achieved, you could either write your own TCP and MPTCP stack or give me a call ! There were other practical challenges on how to use this MPTCP/TCP stack at the application level in UPF which would do the shunting of the packets left and right, the proxying if you will, because this shunting needs to fit in with the erstwhile IP data pipeline of UPF. The interface towards the Access side is a GTP encapsulation, but let us not worry too much about it for the moment, it is possible to overcome those challenges and that makes a topic of a separate blog altogether. The bottom line is Truminds UPF works with this usecase and we are excited about this and can help you too with your similar usecase !

The whole bigger picture below describes an end to end view for those who are deep into the implementation of UPF. The picture has been taken from 3GPP TS 29.244

No alt text provided for this image

Before I pen off, here are some important IETF RFC’s which are utilized in the solution –

RFC 793 – (TCP , there are a bunch of other RFC’s, but this is the base RFC for TCP)

RFC 6824, 8684 --  (MPTCP version 0 and version 1)

RFC 8803 (this RFC contains the trick amongst other things so that the Mobile can tell UPF which server on Internet it is trying to reach out to)

3GPP TS 29.244 (this is not an IETF RFC but the 3GPP specification document defining the interface between the Control Plane and UPF, you would find good information there about the MPTCP Proxy in UPF)

Hopefully, you enjoyed reading this blog. Keep tuned for more !

Author: Prashant Upadhyaya and Pankaj Choudhary


More Articles of Pankaj Choudhary:

Name Views Likes
Coding Challenges: Fun Projects for Student Programmers 27 0
5 Must-Have Programming Skills for Student 40 0
Hands-On Experience: Internships and Capstone Projects in Data Science Programs 289 0
5 Tips for Effective Self-Study in Programming Education 159 0
5 Essential Study Techniques for Mastering C++ 219 0
What You Need to Know about Programming Languages 164 0
Pitfalls of Learning Programming 178 0
Truminds 5G UPF supports MPTCP Proxy 9969 214
C++ Assignment Help: Where Can You Find? 492 0
Top Benefits of Learning Coding in College or University 430 0
C++ Abstract Class 860 21
Compile C++11 program using g++ 4178 10
C++ Searching an element in a vector 786 11
Priority Queue 1830 12
Check String is palindrome or not 1259 10
Preorder Tree Traversal with recursion 1148 12
Template based linked list 5627 11
Print all processes running as root 866 28
C++ Queue of objects 4944 18
How to cin to vector 17925 10
Python List Built-In Methods 632 11
Python Basic Programs 588 1
C++ Compare version string 3124 12
C++ Vector of objects 6339 20
Windows enable NTP Server 889 17
Tokenized securities on blockchain 749 0
Difference between remove and remove_if in STL 1049 19
CPU usage per thread without top utility 3002 16
Python Selected Interns (Feb 2019 Batch - 1) 1049 24
Complex Number Program 905 10
Functor with arguments 1339 10
Pass function pointer to a function 541 11
C++ Two dimensional vector 947 21
C++ challange for Aug 2019 Interns 6045 4
C program to get memory usage 9805 18
Python challange for Interns (Feb 2019, Batch 2) 879 13
C++ Read file line by line 917 14
Dynamic Programming - Egg Dropping Problem 1763 16
GDB Print complete string 3162 24
UDP Server Program in C 9212 24
C++ Split string by delimiter and store it in vector 3243 12
Python programs list 788 23
Mutable lambda in C++ 4760 11
C++ Sorting of vector 632 10
Overload Assignment Operator 597 10
Blockchain The Benefits and Risks of Smart Contracts 786 0
Inorder Tree Traversal without recursion 1032 14
Lambdas in C++ 792 11
Inorder Tree Traversal with recursion 815 25
C++ Count maximum number of consecutive ones in a vector 1523 10
C++ Parameter Binding 637 11
Python Converting a String to a List of Words 775 19
Python project to update a doc file conver it to the pdf file and send it to multiple email addresses 1833 29
Test article for interns Python Add Two Numbers 689 12
Ring Buffer 5426 11
Python 2.7 Run linux command and get output 1578 38
C++ Predicate 2299 10
Internship Opportunity at cppsecrets for Nov 2020 batch 5064 1
Find N pairs with smallest sums in two vectors 504 11
C++ Set of objects 852 21
C++ Selected Interns (Feb 2019 Batch - 1) 1148 15
Python challange for Sept 2019 Interns 2521 5
Write your own shared pointer 2495 10
Internship Opportunity at cppsecrets for May 2020 batch 10600 4
C++ Check whether two strings are anagram of each other 3385 12
C++11 Range based for loop 805 11
Erase elements from vector 2125 17
Python send mail 807 22
Git create branch 721 21
ssh Bad owner or permissions 847 0
C++11 decltype 526 12
C++ Read file and store it into integer variable 596 12
Python Tcp Server Example Code 829 12
C++ challange for Oct 2019 Interns 5360 0
Linux - Difference between tty and pts 11156 20
sudo error, is mode 0777, should be 0440 16 10
C++ Config Reader 8785 3
Find maximum product of three numbers 525 11
Python Converting a String to a List of Words based on spaces and alphanumeric characters 975 25
Internship Opportunity at cppsecrets.com 4768 0
C++ map of char* and char* 4629 28
C++11 decltype and typeid 2578 16
Fork system call 879 15
Postorder Tree Traversal with recursion 790 21
How to give paid exam at cppsecrets.com? 1138 0
Functor in C++ 613 11
Internship Opportunity at cppsecrets for UPES Hackathon Participants 752 1
C++11 auto keyword 799 21
C++ Boost Serialization: Serializing primitive data types 55 3
C++ Validate parenthesis pattern 572 10
Dynamic Programming - Rod Cutting Problem 1552 20
Linux Print Process Tree 918 27
Stipend update for the C++ interns of Feb 2019 2464 32
Linux Extract an RPM package without installing it 978 16
Preorder Tree Traversal without recursion 782 16
Internship Opportunity at cppsecrets for March 2020 batch 7956 4
Python challange for Feb 2019 Interns 1092 27
UDP Client Program in C 4151 23
Deep Copy 836 11
Find the Nth largest element in a vector 5472 11
10 Most Frequent Laptop Issues and How to Solve them 450 0
Python Selected Interns (Feb 2019 Batch - 2) 974 21
C++ challange for Interns (Feb 2019, Batch 2) 866 24
Select process by PPID 582 17
C++ typeid operator 3751 21
Python UDP client server example code 5581 29
C++ Abstract classes and pure virtual functions 752 23
fatal error: Python.h: No such file or directory 1420 0
Linux Find out how many file descriptors are opened 726 14
C++ Range based for loop 674 18
Binary Tree Traversal 2952 21
Python Command Line Arguments 993 11
How to install Python Requests Library 692 13
Valgrind complete tutorial 1157 10
Function Pointer 620 10
C++ Is paragraph present in the file 678 22
How to cin to list 7570 10
C++11 Auto Example Code 744 14
Shallow Copy 2034 10
C++ File handling 1491 11
C++ challange for Feb 2019 Interns 1064 11
ps man page 728 19
errno.h Error Codes in Linux 840 15
Write copy constructor, assigment operator and desctructor of class having pointer variable 890 10
popen man page 853 15
C++ Read and write binary file 6267 22
C++ Generic file writer class 1188 22
C++ Object Slicing 637 14
OpenSSL generate hash of the file 1960 22
Singleton Class using C++ 11 4568 12
C++ challange for Interns May 2019 1473 21
C++ Pass local variable to Functor 741 10
Nested Template Class 1185 11
Python Sum of all the items in a list 546 11
How to give internship exam at cppsecrets.com 2550 1
C++ Selected Interns (Feb 2019 Batch - 2) 997 19
Run unix command and get output 3199 28
Python Top MOST famous Python libraries and framework 805 29
Linux - find all the shell/terminals are running 851 29
Python challange for May 2019 Interns 1178 15
Linux Select Process By PPID 817 20
C++ File read and write 587 12
C++ Best way to trim std::string 5383 28
Build-in Functors 556 10
C++ Template with default arguments 738 20
How To Move Forward After Losing Your Job Due To Covid 318 0
Truminds 5G UPF now runs in 6WINDGate as a plugin 12656 2312

Comments