# 蔡瀚興-讀書會-21/07/14
## 推薦連結
- [4G EPS Session](https://www.twblogs.net/a/5db34e07bd9eee310da03b24)
- [4G EPS Bearer](https://www.cnblogs.com/jmilkfan-fanguiju/p/12789787.html)
## <font color="#FF0000">EPS Session and EPS Bearer Overview:</font>
More than one EPS session and bearer can be established in a UE concurrently ,IDs are needed to identify them

## <font color="#FF0000">EPS Session:</font>
IP connection between a UE and a PDN is called PDN connection or EPS session.
- **PDN connection(EPS session)** = **IP address** + **PDN ID(Access Point Name or APN)**
- More than one EPS bearer to deliver user traffic(IP packets) and Qos
- **Default EPS Bearer:** The minimum fundamental bearer that an EPS session has for a PDN.
### When an EPS session established means...
1. A **PDN** for a user is selected
2. **IP address** used in the PDN is assigned
3. **Policy rules** to be applied have been selected
4. A **Default EPS Bearer** for delivering IP packets has been established
## <font color="#FF0000">EPS Bearer:</font>
EPS Bearer is a pipe through which IP packets are delivered over the LTE network
- **[UE]~[eNB] Radio data bearer (DRB):** identified by their **DRB ID** ; IP packets is delivered through a DRB
- **[eNB]~[S-GW] S1 bearer:** identified by TEID ; IP packets is delivered through a GTP tunnel
- **[S-GW]~[P-GW] S5 bearer:** identified by TEID ; IP packets is delivered through a GTP tunnel
- **E-RAB:** Concatenation of DRB and S1 bearerr ,identified by E-RAB ID ,which allocated by an MME
## <font color="#FF0000">Types of EPS Bearers:</font>
### **Default EPS Bearer:**
Each PDN must have one default EPS bearer. Even when there is no user traffic to send,default EPS bearer **always stay activated**.
### **Dedicated EPS Bearer:**
Established if the default EPS bearer itself is not enough to obtain **Qos**. When there is no traffic,dedicated EPS bearer **can be removed**.
### **Notes**
- **Uplink IP traffic** is mapped from a UE to the EPS bearer
- **Downlin IP traffic** is mapped from a P-GW down to the EPS bearer
## <font color="#FF0000">PDN ID(APN):</font>
An APN ,refer to an access point to a PDN

- **APN** = Network ID + Operator ID
- **Network ID:** Used to identify PDNs such as Internet ,enterprise VPN ,or to identify the services(ex:IMS)
### Path
1. UE's initial attach,APN will be donloaded from HSS to MME
2. MME selects a PDN to connect the UE
3. MME selects a P-GW for UE to connect to the PDN
## <font color="#FF0000">EPS Bearer IDs</font>
An EPS bearer is virtual connection set between a UE and a P-GW.

- Different bearers in the EPS are identified by **4-bit EPS bearer IDs**
##

- UE and P-GW both perform **traffic flow filtering** to decide to which EPS bearer each IP flow is to be delivered
##

##

## <font color="#FF0000">E-RAB ID:</font>
Identified by a **4-bit E-RAB ID**
- Assigned by an **MME**
- Generally ,with the **same value** as the EPS bearer ID
- MME requests the eNB ,then **eNB creates** DRB and S1 bearer
- If UE idle ,**only S5 bearer stays on**. But ,when new user traffic arrives ,E-RAB will **re-established**
## <font color="#FF0000">DRB ID:</font>
Identified by a **4-bit DRB ID**
- DRB is set over the **radio link** between UE and eNB
- eNB creates DRB for communication with UE by assigning a **DRB ID** and selecting **logical channel configuration parameters** based on the required QoS
## <font color="#FF0000">TEID</font>
ID to identify the endpoints of GTP tunnel
- GTP tunnels are identified by TEID ,in **32-bit integer**
- **S5 bearer:** S-GW allocates **DL S5 TEID** ,P-GW allocates **UL S5 TEID**
- **S1 bearer:** S-GW assigns **UL S1 TEID** ,eNB assigns **DL S1 TEID**
## <font color="#FF0000">LBI</font>
ID to connect a **default EPS bearer** and **dedicated EPS bearer**
- Both bearers belong to the **same PDN** for same user
- **Default EPS bearer ID is used as the LBI**
- MME allocates a bearer ID ,which also is assigned as a LBI