Commit 254fc13b authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

bug fix for one-to-one unicast

parent 5baa7a5d
......@@ -44,26 +44,32 @@ 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): ip neigh add 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
- (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): ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
- (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
......@@ -79,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)
......@@ -99,19 +105,25 @@ 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): ip neigh add 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
- (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): ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
- (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)
......@@ -134,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
......@@ -170,16 +182,20 @@ 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):
ip neigh add 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
ip neigh add 10.0.0.4 lladdr 00:00:00:00:00:04 dev oip0 nud permanent
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):
ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
ip neigh add 10.0.0.4 lladdr 00:00:00:00:00:04 dev oip0 nud permanent
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
......@@ -187,15 +203,17 @@ 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):
ip neigh add 10.0.0.2 lladdr 00:00:00:00:00:02 dev oip0 nud permanent
ip neigh add 10.0.0.1 lladdr 00:00:00:00:00:01 dev oip0 nud permanent
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: sudo ./lte-softmodem-stub -U --emul-iface eno1
- UE2: ssudo ./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
......@@ -203,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
......
......@@ -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>
......@@ -58,7 +58,7 @@
//#define OAI_DRV_DEBUG_SEND
//#define OAI_DRV_DEBUG_RECEIVE
#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);
......@@ -200,13 +203,16 @@ skb_p->mark = rb_idP;
#endif
if (hard_header_len == 0) {
skb_p->protocol = htons(ETH_P_IP);
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");
}
//---------------------------------------------------------------------------
......
......@@ -377,8 +377,8 @@ void ue_ip_init(struct net_device *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 = UE_IP_ADDR_LEN;
/* 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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment