Default_Dedicated_bearer_Creation in LTE network

This document will explain about the new bearer allocation on top of default bearer.

First we will cover the default bearer creation and then we will cover the allocation of dedicated bearer.

Default Bearer Creation:

Here I will elaborate more on GTP perspective for creating default bearer. Please refer the following points when attach request initiated by UE,

  1. UE initiate a “Attach Request” towards eNB with the UE information such as IMSI, UE Core Network Capability, Attach Type, NAS information, RRC parameters etc.
  2. ENB derives MME from RRC parameter and forward the “Attach Request” i.e. S1-MME message (Initial UE Message) towards MME with the Selected Network, CSG ID (Common subscriber group), and TAI+ECGI information.
  3. MME will initiate a GTP-C signaling message towards S-GW to proceed with attach. This will help the EPS (Evolved Packet system) to create default bearer in the network. MME initiates Create Session Request with the following important information
    1. IMSI
    2. MME’s F-TEID for control plane (MME IP + TEID (Tunnel ID)). This will be used for future communication with MME.
    3. PGW’s G-TEID for Control plane (P-GW IP + TEID (here it will be zero)). This will be used by S-GW to communicate with P-GW.
    4. Bearer Context to be created. This is the bearer information to be created at MME. This will include the default bearer ID with TFT, QOS.
    5. APN
    6. Recovery
  4.   S-GW will process the “Create Session Request” initiated by MME and create the UE, eNB, and MME context and modify the Create session Request and send it to P-GW. Create session Request from S-GW will have the following important information
    1. IMSI
    2. S-GW’s F-TEID for control plane (S-GW IP + TEID (Tunnel ID)). This will be used for future communication with S-GW.
    3. Bearer Context to be created. This is the bearer information to be created at S-GW. This will include the default bearer ID with TFT, QOS, S-GW user plane F-TEID
    4. APN
    5. Recovery
  5.  Once P-GW receives “Create Session Request” , it will create UE, S-GW context and communicate with PCRF for QOS and APN resolve. If that succeed, P-GW will respond back with “Create Session Response” towards S-GW. The Create Session Response will have following information:
    1. Cause. This value will be used for Success/failure for the Create Session Request.
    2. P-GW’s F-TEID for control plane (P-GW’s IP + TEID ). This information will be used for future signaling message communication with P-GW.
    3. PAA (PDN Address Allocation).
    4. Bearer Contexts Created. This information element will have Default EPS bearer ID, P-GW user plane F-TEID, TFT, Bearer Qos, Charging ID.
    5. Charging GW
    6. Recovery
  6. Once S-GW receives “Create Session Response”, it will create P-GW context and forward/process the “Create Session Response “with the following information.
    1.  Cause. This value will be used for Success/failure for the Create Session Request.
    2. S-GW’s F-TEID for control plane (S-GW’s IP + TEID ). This information will be used for future signaling message communication with S-GW.
    3. PAA (PDN Address Allocation).
    4. Bearer Contexts Created. This information element will have Default EPS bearer ID, P-GW user plane F-TEID, TFT, Bearer Qos, Charging ID.
    5. Charging GW
    6. Recovery
  7. Now if downlink data comes from PDN it will get buffered in S-GW as user plane eNB information shared with S-GW.
  8. MME shares the eNB information as part of attach procedure with “Modify Bearer request” with the following information. (Bearer Contexts to be modified. This IE will have eNB’s user plane F-TEID.)
  9. Once S-GW receives the “Modify Bearer request” with eNB information.  It will respond back with “Modify bearer Response”.
  10. Now downlink data can be sent to eNB because S-GW has the information of eNB.
  11. But uplink data can possible after step 6.

Cited from:

http://lte-gtp.blogspot.com/2012/02/defaultdedicatedbearercreation-in-lte.html

Functionality of Different LTE Nodes

LTE Architecture
LTE network compromises of the following nodes:

  • UE (User Endpoint)
  • MME (Mobile Management Entity)
  • S-GW (Serving Gateway)
  • P-GW (PDN Gateway)
  • PDN (Packet Data Network or IP world)
  • PCRF (Policy and Charging Enforcement Function)
  • eNB (e Node B)
  • SGSN (Serving GPRS Support Node)
  • HSS (Home Subscriber SubSystem)
  • E-UTRAN (Collection of eNB)
  • EPC (Combination of MME, S-GWand P-GW)
The Architecture of LTE network look like this:
LTE Non-Roaming architecture
The communication between different nodes of LTE work like this:
We will go deeper to describe about the different interface between different nodes, functionality and the layering structure of LTE Nodes.
Interfaces between different Nodes:
Uu-Interface: This interface is in between UE and eNB. This is a radio/air interface and OFDMA (Orthogonal Frequency Division Multiple access) technology is used to send uplink packet and SC-FDMA technology is being used to send downlink packet.
X2-Interface: This interface is in between eNB and eNB. Under this interface the UDP being used as Transport protocol and GTP being used as Application protocol. Basically this interface is used for Handover.
S1-U Interface: This interface is in between eNB and S-GW and this interface will be used for data path communication. Under this interface  UDP will be used as Transport protocol and GTP-U protocol will be used for application protocol
S1-AP Interface: This interface is in between eNB and MME. This interface is used for sending signalling packet between eNB and MME. Under this interface SCTP will be used as transport protocol and S1-AP will be used as application protocol.
S11 Interface: This interface is in between MME and S-GW. this interface will be used for Signalling communication between MME and S-GW. Under this interface UDP will be used as transport protocol and GTP-C will be used as application protocol.
S5-C Interface: This interface is in between S-GW and P-GW. This interface will be used for signalling between S-GW and P-GW. Under this interface UDP will be used for transport protocol and GTP-C will be used for applicatio protocol.
S5-U Interface: This interface is in between S-GW and P-GW. This interface will be used for data path. Under this interface UDP will be used for transport protocol and GTP-U will be used for application protocol.

S6a Interface: This interface is in between MME and HSS. This interface will be used for Authentication, Authorization and Accounting. The SCTP will be used for transport protocol and Diameter will be used for application protocol.

Functionality of LTE Nodes:
eNodeB
The following functionality for eNodeB in LTE network:

–     Header compression and user plane ciphering;
–     MME selection when no routing to an MME can be determined from the information provided by the UE;
–     UL bearer level rate enforcement based on UE-AMBR and MBR via means of uplink scheduling
(e.g. by limiting the amount of UL resources granted per UE over time);
–     DL bearer level rate enforcement based on UE-AMBR;
–     UL and DL bearer level admission control;
–     Transport level packet marking in the uplink, e.g. setting the DiffServ Code Point, based on the QCI of the associated EPS bearer;
–     ECN-based congestion control.

MME
The different functionality of MME are:

–     NAS signalling;
–     NAS signalling security;
–     Inter CN node signalling for mobility between 3GPP access networks (terminating S3);
–     UE Reachability in ECM-IDLE state (including control and execution of paging retransmission);
–     Tracking Area list management;
–     Mapping from UE location (e.g. TAI) to time zone, and signalling a UE time zone change associated with mobility,
–     PDN GW and Serving GW selection;
–     MME selection for handovers with MME change;
–     SGSN selection for handovers to 2G or 3G 3GPP access networks;
–     Roaming (S6a towards home HSS);
–     Authentication;
–     Authorization;
–     Bearer management functions including dedicated bearer establishment;
–     Lawful Interception of signalling traffic;
–     Warning message transfer function (including selection of appropriate eNodeB);
–     UE Reachability procedures.
cited from:

GTP-C Overview

GTP-C tunnels are used between two nodes communicating over a GTP based interface, to separate traffic into different communication flows.

A GTP-C tunnel is identified in each node with a TEID, an IP address and a UDP port number.
Each node will be uniquly identified by F-TEID (Fully Qualified Tunnel identifier) in a global network. Each node will share their   TEID for both signalling and Data path.

There are different version of GTP-C. I will cover more on GTPv2.
In GTPv2-C protocol, three type of messages are there.

  1. Initial Message
  2. Triggered Message
  3. piggy backed message

Initial Message: As name says, who is initiating a request or Command is a Initial Message. e.g. Create Session Request, Bearer Resource Command etc. Always the Initial message will get forward to 2123 for GTP-C and 2152 for GTP-U

Triggered Message: This message is a response message of Initial Message. In Triggered message will use the port same as the source of Initial message. e.g Create Bearer request for Bearer resource Command.

Piggybacked Message: This message is a combination of two GTP-C message with one GTP-C header. e.g. Create Session Response will piggyback Create Bearer Request and same way Create Bearer Response will piggyback Modify Bearer Request.

The GTP-C message has the following format:

Bits
Octets 8 7 6 5 4 3 2 1
1 to m GTP-C header
m+1 to n Zero or more Information Element(s)

The GTP-C message is a combination of GTP-C header and zero or more Information Element.
The Format of GTP-C header is:

Bits
Octets 8 7 6 5 4 3 2 1
1 Version P T=1 Spare Spare Spare
2 Message Type
3 Message Length (1st Octet)
4 Message Length (2nd Octet)
5 Tunnel Endpoint Identifier (1st Octet)
6 Tunnel Endpoint Identifier (2nd Octet)
7 Tunnel Endpoint Identifier (3rd Octet)
8 Tunnel Endpoint Identifier (4th Octet)
9 Sequence Number (1st Octet)
10 Sequence Number (2nd Octet)
11 Sequence Number (3rd Octet)
12 Spare

1st Octet
The 4th bit of first octet is the ‘T’ bit means, If this flag is set then the 4 byte TEID will be available in the GTP-C  message.
The 5th bit of first octet is the ‘P’ bit means, if this bit is set then the message will be considered as piggybacked message.
The 6,7 and 8th bit is combination for version of GTP-C message.
2nd Octet
This octet is for message type of the GTP-C message.
3rd & 4th Octet
These octets are used for Message length of GTP-C header. The length of the message is from TEID field to the end of the message i.e excluding the 4 byte from the GTP-C message.
5th, 6th, 7th & 8th Octet
These octets are used for Tunnel identifier value. these octets will be absent if ‘T’ bit is set to 0.
9th, 10th and 11th Octet
These octets are used for sequence no of the GTP-C message.

The GTP-C messages are divided into two parts.
1. Path Management
2. Tunnel Management

 

Cited from: http://lte-gtp.blogspot.com/2011/07/gtp-c-overview.html

gcc compilation

  1. Preprocesser: replace include .h with the actual code, replace macro, remove comments.
  2. Compiler: compile .c file to assembly code. –> .s
  3. Assembler: convert assembly code .s to binary code .o
  4. Linker: combine binary code together
  5. Loader:

user program processing

git config/remote add/

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

$ git remote set-url origin git@github.com:username/repo.git

$ git remote add origin https://github.com/user/repo.git
# Set a new remote
$ git remote -v
# Verify new remote

$ git remote show origin

211. Add and Search Word – Data structure design

Design a data structure that supports the following two operations:

void addWord(word)
bool search(word)

search(word) can search a literal word or a regular expression string containing only letters a-z or .. A . means it can represent any one letter.

For example:

addWord("bad")
addWord("dad")
addWord("mad")
search("pad") -> false
search("bad") -> true
search(".ad") -> true
search("b..") -> true

Note:
You may assume that all words are consist of lowercase letters a-z.

public class WordDictionary {

    public class TrieNode {
        // We do not need this value stroed in the trie node.
        // char c;
        TrieNode[] children;
        boolean isWord;
        public TrieNode() {
            children = new TrieNode[26];
            isWord = false;
        }
    }
    
    private TrieNode root;
    
    /** Initialize your data structure here. */
    public WordDictionary() {
        root = new TrieNode();
    }
    
    /** Adds a word into the data structure. */
    public void addWord(String word) {
        if (word == null || word.length() == 0) return;
        TrieNode node = root;
        for (int i = 0; i < word.length(); i++) {
            char c = word.charAt(i);
            if (node.children[c - 'a'] == null) node.children[c - 'a'] = new TrieNode();
            node = node.children[c - 'a'];
        }
        node.isWord = true;
    }
    
    /** Returns if the word is in the data structure. A word could contain the dot character '.' to represent any one letter. */
    public boolean search(String word) {
        return helper(word, 0, root);
    }
    
    public boolean helper(String word, int level, TrieNode node) {
        if (level == word.length()) return node.isWord;
        char c = word.charAt(level);
        if (c == '.') {
            for (int i = 0; i < node.children.length; i++) {
                if (node.children[i] != null && helper(word, level + 1, node.children[i])) {
                    return true;
                }
            }
            return false;
        } else if (node.children[c - 'a'] != null) {
            return helper(word, level + 1, node.children[c - 'a']);
        } else return false;
    }
}

/**
 * Your WordDictionary object will be instantiated and called as such:
 * WordDictionary obj = new WordDictionary();
 * obj.addWord(word);
 * boolean param_2 = obj.search(word);
 */

498. Diagonal Traverse

Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order as shown in the below image.

Example:

Input:
[
 [ 1, 2, 3 ],
 [ 4, 5, 6 ],
 [ 7, 8, 9 ]
]
Output:  [1,2,4,7,5,3,6,8,9]
Explanation:

Note:

  1. The total number of elements of the given matrix will not exceed 10,000.
/**
public class Solution {
    public int[] findDiagonalOrder(int[][] matrix) {
        if (matrix == null || matrix.length == 0 || matrix[0].length == 0) return new int[0];
        int row = 0;
        int col = 0;
        int tag = 1;
        int m = matrix.length;
        int n = matrix[0].length;
        int[] result = new int[m * n];
        for (int i = 0; i < m * n; i++) {
result[i] = matrix[row][col];
row -= tag;
col += tag;
// Should pay attention to the other of checking 0 and m/n bound.
// Should check m/n bound first, or tag willl be reversed twice.
// row/col should plus 2 rather than 1 in this case.
if (row > m - 1) {row = m - 1; col += 2; tag = -tag;}
            if (col > n - 1) {col = n - 1; row += 2; tag = -tag;}
            if (row < 0) {row = 0; tag = -tag;}
            if (col < 0) {col = 0; tag = -tag;}
        }
        return result;
    }
}
*/
// Solution 2: instead using tag directly, we can also use a dictionary.
public class Solution {
    public int[] findDiagonalOrder(int[][] matrix) {
        if (matrix == null || matrix.length == 0) return new int[0];
        int m = matrix.length;
        int n = matrix[0].length;
        int row = 0;
        int col = 0;
        int tag = 0;
        int[][] dict = {{-1, 1}, {1, -1}};
        int[] result = new int[m * n];

        for (int i = 0; i < m * n; i++) {
result[i] = matrix[row][col];
row += dict[tag][0];
col += dict[tag][1];
if (row > m - 1) {row = m - 1; col += 2; tag = 1 - tag;}
             if (col > n - 1) {col = n - 1; row += 2; tag = 1 - tag;}
             if (row < 0) {row = 0; tag = 1 - tag;}
             if (col < 0) {col = 0; tag = 1 - tag;}
}
return result;
}
}

/* In the onsite inteview from Bloomberg, I came across a similar problem, instead of traverse with two directions,
the oder in the problem I came across is from bottom left to upper right for each diagnal traversal,
the code can be like the following: */
public class Solution {     // The order of each diagonal traversal is bottom left -> upper right.
    public int[] findDiagonalOrder(int[][] matrix) {
        if (matrix == null || matrix.length == 0) return new int[0];
        int m = matrix.length - 1;
        int n = matrix[0].length - 1;
        int[] result = new int[(m + 1) * (n + 1)];
        int row = 0;
        int col = 0;
        int index = 0;
        for (int sum = 0; sum <= m + n; sum++) {
// row = sum > m ? m : sum;
            row = Math.min(sum, m);
            col = sum - row;
            while (row >= 0 && col <= n) {
                result[index++] = matrix[row--][col++];
                // The following lines can be combined to the single line above.
//                 result[index] = matrix[row][col];
//                 row -= 1;
//                 col += 1;
//                 index++;
            }
        }
        return result;
    }
}