Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
2e3e573b
Commit
2e3e573b
authored
Nov 14, 2018
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Plain Diff
Merge latest extensions from on-off-integration branch
parents
c7bf4f8a
61db78c3
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
250 additions
and
43 deletions
+250
-43
d2d_emulator_setup.txt
d2d_emulator_setup.txt
+53
-12
openair2/LAYER2/MAC/ue_procedures.c
openair2/LAYER2/MAC/ue_procedures.c
+55
-5
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+1
-0
openair2/NETWORK_DRIVER/UE_IP/common.c
openair2/NETWORK_DRIVER/UE_IP/common.c
+33
-14
openair2/NETWORK_DRIVER/UE_IP/device.c
openair2/NETWORK_DRIVER/UE_IP/device.c
+35
-5
openair2/RRC/LITE/rrc_UE.c
openair2/RRC/LITE/rrc_UE.c
+29
-5
openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
+4
-2
relay_UE_routing.sh
relay_UE_routing.sh
+22
-0
remote_UE_routing.sh
remote_UE_routing.sh
+18
-0
targets/DOCS/D2D-on-net-and-relay-setup-instructions.pdf
targets/DOCS/D2D-on-net-and-relay-setup-instructions.pdf
+0
-0
No files found.
d2d_emulator_setup.txt
View file @
2e3e573b
...
...
@@ -43,21 +43,33 @@ Get and build vencore_app from d2d-l3-stub (branch: l3_stub)
UE1:
- sudo ifconfig oip0 10.0.0.1
- (if necessary) sudo route add default gw 10.10.10.1 eth0
- sudo ifconfig oip0 hw ether 00:00:00:00:00:01
- (optional, in case ARP fails to work with oip interface):
sudo ip neigh add 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
or
sudo ip neigh change 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
UE2:
- sudo ifconfig oip0 10.0.0.2
- (if necessary) sudo route add default gw 10.10.10.1 eno1
- sudo ifconfig oip0 hw ether 00:00:00:00:00:02
- (optional, in case ARP fails to work with oip interface):
sudo ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
or
sudo ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
For the moment, we suppose that L2Ids of UE1, UE2 are Ox01, 0x02 respectively. GroupL2Id is set to 0x03.
--------------------------------
TEST ONE-TO-MANY
Run UE1 then UE2, for example:
- UE1: sudo ./lte-
softmodem-stub -U
--emul-iface eth0
- UE1: sudo ./lte-
uesoftmodem -U --D2D-emul 1
--emul-iface eth0
- UE1 ./vencore_app -g 0x01 0x03 #0x01 - UE1-L2Id, 0x03-groupL2Id
# a SLRB will be established for this communication (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark XXX #XXX is SLRB_ID
- UE2: sudo ./lte-
softmodem-stub -U
--emul-iface eno1
- UE2: sudo ./lte-
uesoftmodem -U --D2D-emul 1
--emul-iface eno1
- UE2 ./vencore_app -g 0x02 0x03 #0x02 - UE2-L2Id, 0x03-groupL2Id
# a SLRB will be established for this communication (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark XXX #XXX is SLRB_ID
...
...
@@ -73,14 +85,14 @@ Test with Iperf
Filter the incomming packets according to GroupL2Id: receiver (one-to-many) can discard the packets if it doesn't belong to this group.
UE1 (sender)
- sudo
./lte-softmodem-stub -U
--emul-iface eth0
- sudo
sudo ./lte-uesoftmodem -U --D2D-emul 1
--emul-iface eth0
- ./vencore_app -g 0x01 0x03 #0x01 - UE1's L2Id, 0x03-groupL2Id
# a SLRB will be established for this communication (check SLRB_ID from vencore_app's screen)
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 224.0.0.3 -j MARK --set-mark XXX #XXX is SLRB_ID
- ping -I oip0 224.0.0.3
UE2(receiver)
- sudo ./lte-
softmodem-stub -U
--emul-iface eno1
- sudo ./lte-
uesoftmodem -U --D2D-emul 1
--emul-iface eno1
#we can see the incomming packets from OAI log, however, cannot see from Wireshark -> they are discarded at MAC layer
-./vencore_app -g 0x02 0x03 #0x02 - UE2-L2Id, 0x03-groupL2Id
# a SLRB will be established for this communication (check SLRB_ID from vencore_app's screen)
...
...
@@ -92,15 +104,26 @@ TEST PC5-S (UE1 - sender, UE2 - receiver) and PC5-U for ONE-TO-ONE scenario (and
Configure UE1/UE2
UE1:
- sudo ifconfig oip0 10.0.0.1
- sudo ifconfig oip0 hw ether 00:00:00:00:00:01
- (optional, in case ARP fails to work with oip interface):
sudo ip neigh add 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
or
sudo ip neigh change 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
- sudo route add default gw 10.10.10.1 eth0
UE2:
- sudo ifconfig oip0 10.0.0.2
- sudo ifconfig oip0 hw ether 00:00:00:00:00:02
- (optional, in case ARP fails to work with oip interface):
sudo ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
or
sudo ip neigh change 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
- sudo route add default gw 10.10.10.1 eno1
step 1:
- UE1: sudo ./lte-
softmodem-stub -U
--emul-iface eth0
- UE1: sudo ./lte-
uesoftmodem -U --D2D-emul 1
--emul-iface eth0
step 2:
- UE2: sudo ./lte-
softmodem-stub -U
--emul-iface eno1
- UE2: sudo ./lte-
uesoftmodem -U --D2D-emul 1
--emul-iface eno1
- UE2: ./vencore_app -r 0x02 0x01 #listen to incomming PC5-S message and incomming PC5-U packet from UE1, 0x02 - UE2-L2Id, 0x01 - UE1-L2Id
# mark the packets with the corresponding SLRB (since UE2 is receiver, we should mark only the unicast flow)
# 2 SLRBs will be established: 1 for unicast communication and 1 for multicast (check SLRB_ID from vencore_app's screen)
...
...
@@ -123,10 +146,10 @@ Generate multicast traffic
--------------------------------------
TEST PC5-D
step 1:
- UE1: sudo ./lte-
softmodem-stub -U
--emul-iface eth0
- UE1: sudo ./lte-
uesoftmodem -U --D2D-emul 1
--emul-iface eth0
- UE1: ./vencore_app -d #send a PC5-Discovery-Announcement via PC5D
step 2:
- UE2: sudo ./lte-
softmodem-stub -U
--emul-iface eno1
- UE2: sudo ./lte-
uesoftmodem -U --D2D-emul 1
--emul-iface eno1
- UE2: ./vencore_app -d #send a PC5-Discovery-Announcement via PC5D
...
...
@@ -157,22 +180,40 @@ TEST PC5-U for ONE-TO-ONE scenario (UE1 - sender, UE2/3 - receiver) and PC5-U fo
- configure UE1, UE2, UE3 as mentioned in the previous section
UE1:
- sudo ifconfig oip0 10.0.0.1
- sudo ifconfig oip0 hw ether 00:00:00:00:00:01
- (optional, in case ARP fails to work with oip interface):
sudo ip neigh add 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
(sudo ip neigh change 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent)
sudo ip neigh add 10.0.0.4 lladdr 00:00:00:00:00:04 dev oip0 nud permanent
(sudo ip neigh change 10.0.0.4 lladdr 00:00:00:00:00:04 dev oip0 nud permanent)
- sudo route add default gw 10.10.10.1 eth0
UE2:
- sudo ifconfig oip0 10.0.0.2
- sudo ifconfig oip0 hw ether 00:00:00:00:00:02
- (optional, in case ARP fails to work with oip interface):
sudo ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
(ip neigh change 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent)
sudo ip neigh add 10.0.0.4 lladdr 00:00:00:00:00:04 dev oip0 nud permanent
(sudo ip neigh change 10.0.0.1 lladdr 00:00:00:00:00:04 dev oip0 nud permanent)
- sudo route add default gw 10.10.10.1 eno1
- configure UE3
UE3:
- sudo ifconfig oip0 10.0.0.4
- sudo ifconfig oip0 hw ether 00:00:00:00:00:04
- (optional, in case ARP fails to work with oip interface):
sudo ip neigh add 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
(sudo ip neigh change 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent)
sudo ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
(sudo ip neigh change 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent )
- sudo route add default gw 10.10.10.1 eno1
Step 1:
- UE1: sudo ./lte-
softmodem-stub -U
--emul-iface eth0
- UE1: sudo ./lte-
uesoftmodem -U --D2D-emul 1
--emul-iface eth0
Step 2:
- UE2: s
udo ./lte-softmodem-stub -U
--emul-iface eno1
- UE2: s
sudo ./lte-uesoftmodem -U --D2D-emul 1
--emul-iface eno1
- UE2: ./vencore_app -r 0x02 0x01 # listen to incomming PC5-S message and incomming PC5-U packet from UE1, 0x02 - UE2-L2Id, 0x01 - UE1-L2Id
# groupL2Id is hardcoded for the moment (0x03, Ox05)
# mark the packets with the corresponding SLRB
...
...
@@ -180,7 +221,7 @@ Step 2:
# since UE2 is receiver, we should mark only the unicast flow
- sudo iptables -A POSTROUTING -t mangle -o oip0 -d 10.0.0.1 -j MARK --set-mark XXX #XXX is SLRB_ID for unicast communication
- UE3: sudo ./lte-
softmodem-stub -U
--emul-iface eno1
- UE3: sudo ./lte-
uesoftmodem -U --D2D-emul 1
--emul-iface eno1
- UE3: ./vencore_app -r 0x04 0x01 # listen to incomming PC5-S message and incomming PC5-U packet from UE1, 0x04 - UE3-L2Id, 0x01 - UE1-L2Id
# groupL2Id is hardcoded for the moment (0x03, Ox05)
# mark the packets with the corresponding SLRB
...
...
openair2/LAYER2/MAC/ue_procedures.c
View file @
2e3e573b
...
...
@@ -977,9 +977,9 @@ void ue_send_sl_sdu(module_id_t module_idP,
LOG_D
(
MAC
,
"SL_RESET_RLC_FLAG_NO
\n
"
);
}
LOG_I
(
MAC
,
"%d.%d myL2Id %d sending sdu of size %d, sourceL2Id %d, lcid %d to RLC
\n
"
,
frameP
,
subframeP
,
UE_mac_inst
[
module_idP
].
sourceL2Id
,
rlc_sdu_len
,
sourceL2Id
,
lcid
);
if
(
UE_rrc_inst
[
0
].
Info
[
0
].
rnti
==
0
){
mac_rlc_data_ind
(
module_idP
,
0x1234
,
...
...
@@ -996,6 +996,25 @@ void ue_send_sl_sdu(module_id_t module_idP,
,
reset_flag
#endif
);
}
else
{
mac_rlc_data_ind
(
module_idP
,
UE_rrc_inst
[
0
].
Info
[
0
].
rnti
,
eNB_index
,
frameP
,
ENB_FLAG_NO
,
MBMS_FLAG_NO
,
lcid
,
//3/10
rlc_sdu
,
rlc_sdu_len
,
1
,
NULL
#ifdef Rel14
,
reset_flag
#endif
);
}
}
else
{
//SL_DISCOVERY
uint16_t
len
=
sdu_len
;
LOG_D
(
MAC
,
"SL DISCOVERY
\n
"
);
...
...
@@ -2312,7 +2331,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
buflen
-
sdu_length_total
-
payload_offset
);
// cycle through SDUs and place in ulsch_buffer
if
(
sdu_length_total
)
{
//LOG_I(MAC, "
Panos-D:
[UE %d] ue_get_sdu() 2 before copying to ulsch_buffer, SFN/SF: %d/%d \n \n \n", module_idP, frameP, subframe);
//LOG_I(MAC, "[UE %d] ue_get_sdu() 2 before copying to ulsch_buffer, SFN/SF: %d/%d \n \n \n", module_idP, frameP, subframe);
memcpy
(
&
ulsch_buffer
[
payload_offset
],
ulsch_buff
,
sdu_length_total
);
}
...
...
@@ -3362,8 +3381,14 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
if (ue->sl_info[i].LCID > 0) {
// for (int j = 0; j < ue->numCommFlows; j++){
if ((ue->sourceL2Id > 0) && (ue->sl_info[i].destinationL2Id >0) ){
if(UE_rrc_inst[0].Info[0].rnti == 0){
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].destinationL2Id );
}
else{
rlc_status = mac_rlc_status_ind(module_idP, UE_rrc_inst[0].Info[0].rnti,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].destinationL2Id );
}
if (rlc_status.bytes_in_buffer > 2){
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer \n",frameP,subframeP,rlc_status.bytes_in_buffer);
...
...
@@ -3378,8 +3403,15 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
}
if ((ue->sourceL2Id > 0) && (ue->sl_info[i].groupL2Id >0) ){
if(UE_rrc_inst[0].Info[0].rnti == 0){
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].groupL2Id);
}
else{
rlc_status = mac_rlc_status_ind(module_idP, UE_rrc_inst[0].Info[0].rnti,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].groupL2Id);
}
if (rlc_status.bytes_in_buffer > 2){
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer\n",frameP,subframeP,rlc_status.bytes_in_buffer);
// Fill in group id for off-network communications
...
...
@@ -3408,6 +3440,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
else req = rlc_status.bytes_in_buffer;
if (req>0) {
if(UE_rrc_inst[0].Info[0].rnti == 0){
sdu_length = mac_rlc_data_req(module_idP,
0x1234,
0,
...
...
@@ -3422,6 +3455,23 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
ue->destinationL2Id
#endif
);
}
else{
sdu_length = mac_rlc_data_req(module_idP,
UE_rrc_inst[0].Info[0].rnti,
0,
frameP,
ENB_FLAG_NO,
MBMS_FLAG_NO,
ue->slsch_lcid,
req,
(char*)(ue->slsch_pdu.payload + sizeof(SLSCH_SUBHEADER_24_Bit_DST_LONG))
#ifdef Rel14
,ue->sourceL2Id,
ue->destinationL2Id
#endif
);
}
// Notes: 1. hard-coded to 24-bit destination format for now
if (sdu_length > 0) {
...
...
@@ -3608,7 +3658,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
if
(
slsch_test
==
1
&&
rlc_status
.
bytes_in_buffer
<
2
)
rlc_status
.
bytes_in_buffer
=
300
;
// + 2 to account for the fact that RLC doesn't add the header in the status indication for UE (BSR usage, must be different for SL, to be validated)
if
(
TBS
<=
rlc_status
.
bytes_in_buffer
+
2
)
req
=
TBS
;
if
(
TBS
<=
rlc_status
.
bytes_in_buffer
+
2
)
req
=
TBS
-
sizeof
(
SLSCH_SUBHEADER_24_Bit_DST_LONG
)
;
else
req
=
rlc_status
.
bytes_in_buffer
+
2
;
if
(
req
>
0
)
{
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
View file @
2e3e573b
...
...
@@ -1332,6 +1332,7 @@ rrc_pdcp_config_asn1_req (
DevCheck4
(
drb_id
<
maxDRB
,
drb_id
,
maxDRB
,
ctxt_pP
->
module_id
,
ctxt_pP
->
rnti
);
key
=
PDCP_COLL_KEY_VALUE
(
ctxt_pP
->
module_id
,
ctxt_pP
->
rnti
,
ctxt_pP
->
enb_flag
,
drb_id
,
SRB_FLAG_NO
);
LOG_I
(
PDCP
,
"rnti value: %d, DRB_ID: %d
\n
"
,
ctxt_pP
->
rnti
,
drb_id
);
h_rc
=
hashtable_get
(
pdcp_coll_p
,
key
,
(
void
**
)
&
pdcp_p
);
if
(
h_rc
==
HASH_TABLE_OK
)
{
...
...
openair2/NETWORK_DRIVER/UE_IP/common.c
View file @
2e3e573b
...
...
@@ -34,8 +34,8 @@
#include "rtai_fifos.h"
#endif
#include <linux/inetdevice.h>
#include <linux/etherdevice.h>
#include <net/tcp.h>
#include <net/udp.h>
...
...
@@ -57,8 +57,8 @@
ntohs((addr)->s6_addr16[7])
//
#define OAI_DRV_DEBUG_SEND
//
#define OAI_DRV_DEBUG_RECEIVE
#define OAI_DRV_DEBUG_SEND
#define OAI_DRV_DEBUG_RECEIVE
void
ue_ip_common_class_wireless2ip
(
...
...
@@ -114,11 +114,6 @@ skb_p->mark = rb_idP;
printk
(
"
\n
"
);
#endif
#ifdef OAI_DRV_DEBUG_RECEIVE
printk
(
"[UE_IP_DRV][%s] skb_p->data @ %p
\n
"
,
__FUNCTION__
,
skb_p
->
data
);
printk
(
"[UE_IP_DRV][%s] skb_p->mac_header @ %p
\n
"
,
__FUNCTION__
,
skb_p
->
mac_header
);
#endif
// LG TEST skb_p->ip_summed = CHECKSUM_NONE;
...
...
@@ -163,6 +158,14 @@ skb_p->mark = rb_idP;
}
printk
(
"[UE_IP_DRV][%s] protocol %d
\n
"
,
__FUNCTION__
,
((
struct
iphdr
*
)
&
skb_p
->
data
[
hard_header_len
])
->
protocol
);
//get source/destination MAC addresses
struct
ethhdr
*
mh
=
eth_hdr
(
skb_p
);
#ifdef OAI_DRV_DEBUG_SEND
printk
(
"[UE_IP_DRV] source MAC %x.%x.%x.%x.%x.%x
\n
"
,
mh
->
h_source
[
0
],
mh
->
h_source
[
1
],
mh
->
h_source
[
2
],
mh
->
h_source
[
3
],
mh
->
h_source
[
4
],
mh
->
h_source
[
5
]);
printk
(
"[UE_IP_DRV] dest MAC %x.%x.%x.%x.%x.%x
\n
"
,
mh
->
h_dest
[
0
],
mh
->
h_dest
[
1
],
mh
->
h_dest
[
2
],
mh
->
h_dest
[
3
],
mh
->
h_dest
[
4
],
mh
->
h_dest
[
5
]);
#endif
#endif
skb_set_network_header
(
skb_p
,
hard_header_len
);
...
...
@@ -201,12 +204,15 @@ skb_p->mark = rb_idP;
if
(
hard_header_len
==
0
)
{
skb_p
->
protocol
=
htons
(
ETH_P_IP
);
}
else
{
skb_p
->
protocol
=
eth_type_trans
(
skb_p
,
ue_ip_dev
[
instP
]);
}
//printk("[UE_IP_DRV][COMMON] Writing packet with protocol %x\n",ntohs(skb_p->protocol));
break
;
default:
skb_p
->
protocol
=
eth_type_trans
(
skb_p
,
ue_ip_dev
[
instP
]);
printk
(
"[UE_IP_DRV][%s] begin RB %d Inst %d Length %d bytes
\n
"
,
__FUNCTION__
,
rb_idP
,
instP
,
data_lenP
);
printk
(
"[UE_IP_DRV][%s] Inst %d: receive unknown message (version=%d)
\n
"
,
__FUNCTION__
,
instP
,
ipv_p
->
version
);
}
...
...
@@ -235,6 +241,7 @@ void ue_ip_common_ip2wireless_drop(struct sk_buff *skb_pP, int instP)
//---------------------------------------------------------------------------
ue_ip_priv_t
*
priv_p
=
netdev_priv
(
ue_ip_dev
[
instP
]);
++
priv_p
->
stats
.
tx_dropped
;
printk
(
"[UE_IP_DRV]Packet has been dropped
\n
"
);
}
//---------------------------------------------------------------------------
...
...
@@ -277,8 +284,9 @@ ue_ip_common_ip2wireless(
pdcph
.
data_size
=
skb_pP
->
len
;
if
(
skb_pP
->
mark
)
{
if
(
skb_pP
->
mark
&&
instP
==
0
)
{
pdcph
.
rb_id
=
skb_pP
->
mark
;
printk
(
"[UE_IP_DRV_PROSE] skb_pP->mark %d, oip instance: %d
\n
"
,
skb_pP
->
mark
,
instP
);
}
else
{
pdcph
.
rb_id
=
UE_IP_DEFAULT_RAB_ID
;
}
...
...
@@ -308,13 +316,24 @@ ue_ip_common_ip2wireless(
}
printk
(
"[UE_IP_DRV][%s] slrb_id %d
\n
"
,
__FUNCTION__
,
pdcph
.
rb_id
);
#endif
//get Ipv4 address and pass to PCDP header
pdcph
.
sourceL2Id
=
ntohl
(
((
struct
iphdr
*
)
&
skb_pP
->
data
[
hard_header_len
])
->
saddr
)
&
0x00FFFFFF
;
pdcph
.
destinationL2Id
=
ntohl
(
((
struct
iphdr
*
)
&
skb_pP
->
data
[
hard_header_len
])
->
daddr
)
&
0x00FFFFFF
;
//get source/destination MAC addresses
struct
ethhdr
*
mh
=
eth_hdr
(
skb_pP
);
#ifdef OAI_DRV_DEBUG_SEND
printk
(
"[UE_IP_DRV] source MAC %x.%x.%x.%x.%x.%x
\n
"
,
mh
->
h_source
[
0
],
mh
->
h_source
[
1
],
mh
->
h_source
[
2
],
mh
->
h_source
[
3
],
mh
->
h_source
[
4
],
mh
->
h_source
[
5
]);
printk
(
"[UE_IP_DRV] dest MAC %x.%x.%x.%x.%x.%x
\n
"
,
mh
->
h_dest
[
0
],
mh
->
h_dest
[
1
],
mh
->
h_dest
[
2
],
mh
->
h_dest
[
3
],
mh
->
h_dest
[
4
],
mh
->
h_dest
[
5
]);
#endif
//assign source/destL2Id from the last 24 bits of MAC addresses
pdcph
.
sourceL2Id
=
((
uint8_t
)
mh
->
h_source
[
5
]
&
0x000000FF
)
|
(((
uint8_t
)
mh
->
h_source
[
4
]
<<
8
)
&
0x0000FF00
)
|
(((
uint8_t
)
mh
->
h_source
[
3
]
<<
16
)
&
0x00FF0000
)
;
pdcph
.
destinationL2Id
=
((
uint8_t
)
mh
->
h_dest
[
5
]
&
0x000000FF
)
|
(((
uint8_t
)
mh
->
h_dest
[
4
]
<<
8
)
&
0x0000FF00
)
|
(((
uint8_t
)
mh
->
h_dest
[
3
]
<<
16
)
&
0x00FF0000
);
//get Ipv4 address and pass to PCDP header
//pdcph.sourceL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->saddr) & 0x00FFFFFF;
//pdcph.destinationL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->daddr) & 0x00FFFFFF;
printk
(
"[UE_IP_DRV] source Id: 0x%08x
\n
"
,
pdcph
.
sourceL2Id
);
printk
(
"[UE_IP_DRV] destinationL2Id Id: 0x%08x
\n
"
,
pdcph
.
destinationL2Id
);
#endif
break
;
default:
...
...
openair2/NETWORK_DRIVER/UE_IP/device.c
View file @
2e3e573b
...
...
@@ -304,9 +304,9 @@ struct net_device_stats *ue_ip_get_stats(struct net_device *dev_pP)
int
ue_ip_set_mac_address
(
struct
net_device
*
dev_pP
,
void
*
mac_pP
)
{
//---------------------------------------------------------------------------
//
struct sockaddr *addr = mac_pP;
struct
sockaddr
*
addr
=
mac_pP
;
printk
(
"[UE_IP_DRV][%s] CHANGE MAC ADDRESS UNSUPPORTED
\n
"
,
__FUNCTION__
);
//
memcpy(dev_pP->dev_addr, addr->sa_data, dev_pP->addr_len);
memcpy
(
dev_pP
->
dev_addr
,
addr
->
sa_data
,
dev_pP
->
addr_len
);
return
0
;
}
//---------------------------------------------------------------------------
...
...
@@ -378,15 +378,43 @@ void ue_ip_init(struct net_device *dev_pP)
spin_lock_init
(
&
priv_p
->
lock
);
dev_pP
->
netdev_ops
=
&
ue_ip_netdev_ops
;
dev_pP
->
hard_header_len
=
0
;
dev_pP
->
addr_len
=
UE_IP_ADDR_
LEN
;
dev_pP
->
addr_len
=
ETH_A
LEN
;
dev_pP
->
flags
=
IFF_BROADCAST
|
IFF_MULTICAST
|
IFF_NOARP
;
dev_pP
->
tx_queue_len
=
UE_IP_TX_QUEUE_LEN
;
dev_pP
->
mtu
=
UE_IP_MTU
;
//ether_setup(dev_pP);
}
else
{
printk
(
"[UE_IP_DRV][%s] ERROR, Device is NULL!!
\n
"
,
__FUNCTION__
);
return
;
}
}
//---------------------------------------------------------------------------
// Initialisation of the network device
void
ue_ip_init_sidelink
(
struct
net_device
*
dev_pP
)
{
//---------------------------------------------------------------------------
ue_ip_priv_t
*
priv_p
=
NULL
;
if
(
dev_pP
)
{
priv_p
=
netdev_priv
(
dev_pP
);
memset
(
priv_p
,
0
,
sizeof
(
ue_ip_priv_t
));
spin_lock_init
(
&
priv_p
->
lock
);
dev_pP
->
netdev_ops
=
&
ue_ip_netdev_ops
;
/* dev_pP->hard_header_len = 0;
dev_pP->addr_len = ETH_ALEN;
dev_pP->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP;
dev_pP->tx_queue_len = UE_IP_TX_QUEUE_LEN;
dev_pP->mtu = UE_IP_MTU;
*/
ether_setup
(
dev_pP
);
}
else
{
printk
(
"[UE_IP_DRV][%s] ERROR, Device is NULL!!
\n
"
,
__FUNCTION__
);
return
;
}
}
//---------------------------------------------------------------------------
int
init_module
(
void
)
{
...
...
@@ -403,6 +431,9 @@ int init_module (void)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
ue_ip_dev
[
inst
]
=
alloc_netdev
(
sizeof
(
ue_ip_priv_t
),
devicename
,
ue_ip_init
);
#else
if
(
inst
==
0
)
ue_ip_dev
[
inst
]
=
alloc_netdev
(
sizeof
(
ue_ip_priv_t
),
devicename
,
NET_NAME_PREDICTABLE
,
ue_ip_init_sidelink
);
else
ue_ip_dev
[
inst
]
=
alloc_netdev
(
sizeof
(
ue_ip_priv_t
),
devicename
,
NET_NAME_PREDICTABLE
,
ue_ip_init
);
#endif
...
...
@@ -461,4 +492,3 @@ void cleanup_module(void)
#define DRV_COPYRIGHT "-Copyright(c) GNU GPL Eurecom 2013"
#define DRV_AUTHOR "Lionel GAUTHIER: <firstname.name@eurecom.fr>"DRV_COPYRIGHT
openair2/RRC/LITE/rrc_UE.c
View file @
2e3e573b
...
...
@@ -5772,8 +5772,12 @@ void *rrc_control_socket_thread_fct(void *arg)
//Establish a new RBID/LCID for this communication
// Establish a SLRB (using DRB 4 for now)
UE
=
&
UE_rrc_inst
[
module_id
];
if
(
UE
->
Info
[
0
].
rnti
==
0
){
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
0
,
ENB_FLAG_NO
,
0x1234
,
0
,
0
,
0
);
}
else
{
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
0
,
ENB_FLAG_NO
,
UE_rrc_inst
[
0
].
Info
[
0
].
rnti
,
0
,
0
,
0
);
}
UE
->
DRB_config
[
0
][
0
]
=
CALLOC
(
1
,
sizeof
(
struct
DRB_ToAddMod
));
UE
->
DRB_config
[
0
][
0
]
->
eps_BearerIdentity
=
CALLOC
(
1
,
sizeof
(
long
));
UE
->
DRB_config
[
0
][
0
]
->
drb_Identity
=
group_comm_rbid
;
...
...
@@ -5825,7 +5829,10 @@ void *rrc_control_socket_thread_fct(void *arg)
*
logicalchannelgroup_drb
=
1
;
DRB_ul_SpecificParameters
->
logicalChannelGroup
=
logicalchannelgroup_drb
;
//if(UE->DRB_configList == NULL){
UE
->
DRB_configList
=
CALLOC
(
1
,
sizeof
(
DRB_ToAddModList_t
));
//}
ASN_SEQUENCE_ADD
(
&
UE
->
DRB_configList
->
list
,
UE
->
DRB_config
[
0
][
0
]);
rrc_pdcp_config_asn1_req
(
&
ctxt
,
...
...
@@ -6058,7 +6065,16 @@ void *rrc_control_socket_thread_fct(void *arg)
//Establish a new RBID/LCID for this communication
// Establish a SLRB
UE
=
&
UE_rrc_inst
[
module_id
];
if
(
UE
->
Info
[
0
].
rnti
==
0
){
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
0
,
ENB_FLAG_NO
,
0x1234
,
0
,
0
,
0
);
}
else
{
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
0
,
ENB_FLAG_NO
,
UE_rrc_inst
[
0
].
Info
[
0
].
rnti
,
0
,
0
,
0
);
}
//PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_NO, 0x1234, 0, 0,0);
UE
->
DRB_config
[
0
][
0
]
=
CALLOC
(
1
,
sizeof
(
struct
DRB_ToAddMod
));
UE
->
DRB_config
[
0
][
0
]
->
eps_BearerIdentity
=
CALLOC
(
1
,
sizeof
(
long
));
...
...
@@ -6392,7 +6408,15 @@ void *rrc_control_socket_thread_fct(void *arg)
//Establish a new RBID/LCID for this communication
// Establish a SLRB (starting from 8 for now)
UE
=
&
UE_rrc_inst
[
module_id
];
if
(
UE
->
Info
[
0
].
rnti
==
0
){
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
0
,
ENB_FLAG_NO
,
0x1234
,
0
,
0
,
0
);
}
else
{
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
0
,
ENB_FLAG_NO
,
UE_rrc_inst
[
0
].
Info
[
0
].
rnti
,
0
,
0
,
0
);
}
//PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_NO, 0x1234, 0, 0,0);
UE
->
DRB_config
[
0
][
0
]
=
CALLOC
(
1
,
sizeof
(
struct
DRB_ToAddMod
));
UE
->
DRB_config
[
0
][
0
]
->
eps_BearerIdentity
=
CALLOC
(
1
,
sizeof
(
long
));
...
...
openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
View file @
2e3e573b
...
...
@@ -89,9 +89,11 @@ UE0:
MSIN
=
"0000000001"
;
#USIM_API_K="e56e26f5608b8d268f2556e198a0e01b";
#USIM_API_K="8baf473f2f8fd09487cccbd7097c6862"; #initial
USIM_API_K
=
"11111111111111111111111111111111"
;
#USIM_API_K= "11111111111111111111111111111111"; #nano
USIM_API_K
=
"fec86ba6eb707ed08905757b1bb44b8f"
;
#OPC="e734f8734007d6c5ce7a0508809e7e9c"; #initial
OPC
=
"f47f37e4719a9c379e3447f089b1f10a"
;
#OPC="f47f37e4719a9c379e3447f089b1f10a"; #nano
OPC
=
"C42449363BBAD02B66D16BC975D77CC1"
;
MSISDN
=
"33611123456"
;
};
...
...
relay_UE_routing.sh
0 → 100644
View file @
2e3e573b
#!/bin/bash
# Sidelink interface configuration
sudo
ifconfig oip0 10.0.0.1
sudo
ifconfig oip0 hw ether 00:00:00:00:00:01
# Uu interface configuration for the message exchanges between the eNB and the UE based on loopback interface
sudo
ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up
# Routing and SLRB configuration for specific sidelink (10.0.0.2) and external(e.g., 8.8.8.8) destination addresses.
sudo
ip neigh add 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
sudo
iptables
-A
POSTROUTING
-t
mangle
-o
oip0
-d
10.0.0.2
-j
MARK
--set-mark
4
sudo
ip route add 8.8.8.8 dev oip1
# Applying NAT so that the Remote UE originating/destined traffic does not get blocked at the PGW.
sudo
iptables
-t
nat
-A
POSTROUTING
-o
oip1
-j
MASQUERADE
remote_UE_routing.sh
0 → 100644
View file @
2e3e573b
#!/bin/bash
#Interface configuration
sudo
ifconfig oip0 10.0.0.2
sudo
ifconfig oip0 hw ether 00:00:00:00:00:02
#Routing configuration for specific sidelink destination addresses (sidelink (10.0.0.1))
sudo
ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
#Establishment of SLRB for sidelink communication
sudo
iptables
-A
POSTROUTING
-t
mangle
-o
oip0
-d
10.0.0.1
-j
MARK
--set-mark
4
# Associate destination address (e.g. 8.8.8.8) with the MAC address of the relay UE at the neighbor table
sudo
ip neigh add 8.8.8.8 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
# Mark outgoing packets for specific destination address (e.g. 8.8.8.8) with SLRB id
sudo
iptables
-A
POSTROUTING
-t
mangle
-o
oip0
-d
8.8.8.8
-j
MARK
--set-mark
4
targets/DOCS/
On-D2D-setup
.pdf
→
targets/DOCS/
D2D-on-net-and-relay-setup-instructions
.pdf
View file @
2e3e573b
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment