forked from hugo-ma-alves/OAI-PMIPv6-FM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
umip-1.0-oai-pmipv6.patch
9836 lines (9763 loc) · 412 KB
/
umip-1.0-oai-pmipv6.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[PATCH] Support for PMIPv6 for UMIP 1.0
v20131230: Ported OAI patch to UMIP 1.0
(Romain Kuntz <r.kuntz@ipflavors.com>)
Proxy Mobile IPv6 (PMIPv6) is a network-based mobility management
protocol for localized domains, which has been actively standardized
by IETF. OpenAirInterface Proxy Mobile IPv6 is an implementation of
the RFC 5213 developped by EURECOM. OAI PMIPv6 is opensource under
the GNU General Public License version 2.
Copyright 2013 OpenAir3 - Mobile Communication Department - EURECOM
(Sophia-Antipolis, FRANCE)
This patch is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This patch is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this patch; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
diff -Nur umip/configure.ac umip-pmipv6/configure.ac
--- umip/configure.ac 2013-12-22 18:47:25.000000000 +0100
+++ umip-pmipv6/configure.ac 2013-12-22 18:31:03.000000000 +0100
@@ -89,6 +89,43 @@
AC_MSG_ERROR([POSIX thread library required but not found.])
])
+AC_CHECK_LIB(pcap, pcap_compile, [], [
+ AC_MSG_ERROR([PCAP library required but not found.])
+])
+AC_CHECK_LIB(pcap, pcap_open_live, [], [
+ AC_MSG_ERROR([PCAP library required but not found.])
+])
+AC_CHECK_LIB(pcap, pcap_lookupnet, [], [
+ AC_MSG_ERROR([PCAP library required but not found.])
+])
+AC_CHECK_LIB(pcap, pcap_setfilter, [], [
+ AC_MSG_ERROR([PCAP library required but not found.])
+])
+AC_CHECK_LIB(pcap, pcap_next, [], [
+ AC_MSG_ERROR([PCAP library required but not found.])
+])
+
+AC_ARG_WITH(pmip-use-radius,
+ AC_HELP_STRING([--with-pmip-use-radius],[use radius auth]),
+ [ac_cv_pmip_use_radius=$withval], [ac_cv_pmip_use_radius=no])
+if test x$ac_cv_pmip_use_radius = xyes; then
+ AC_CHECK_LIB(freeradius-client, rc_read_config, [], [
+ AC_MSG_ERROR([freeradius-client library required but not found.])
+ ])
+ AC_CHECK_LIB(freeradius-client, rc_read_dictionary, [], [
+ AC_MSG_ERROR([freeradius-client library required but not found.])
+ ])
+ AC_CHECK_LIB(freeradius-client, rc_avpair_add, [], [
+ AC_MSG_ERROR([freeradius-client library required but not found.])
+ ])
+ AC_CHECK_LIB(freeradius-client, rc_avpair_get, [], [
+ AC_MSG_ERROR([freeradius-client library required but not found.])
+ ])
+ AC_CHECK_LIB(freeradius-client, rc_avpair_free, [], [
+ AC_MSG_ERROR([freeradius-client library required but not found.])
+ ])
+fi
+
AC_CHECK_LIB(netlink, rtnl_talk)
AM_CONDITIONAL(LOCAL_NETLINK, test x$ac_cv_lib_netlink_rtnl_talk = xno)
@@ -109,6 +146,13 @@
[ac_cv_use_builtin_crypto], [ac_cv_use_builtin_crypto=no])
AM_CONDITIONAL(BUILTIN_CRYPTO, test x$ac_cv_lib_crypto_HMAC_Init = xno)
+if test ac_cv_pmip_use_radius = xyes; then
+ AC_DEFINE([USE_RADIUS], [1], [USE RADIUS AUTH])
+fi
+AC_CACHE_CHECK([whether to use RADIUS client library],
+ [ac_cv_pmip_use_radius], [ac_cv_pmip_use_radius=no])
+AM_CONDITIONAL(USE_RADIUS, test x$ac_cv_pmip_use_radius = xyes)
+
dnl Option --disable-debug
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--disable-debug],[disable debug messages and asserts]),
@@ -213,6 +257,7 @@
Use built-in crypto: ............ $ac_cv_use_builtin_crypto
Use OpenSSL crypto library: ..... $ac_cv_lib_crypto_HMAC_Init
+ Use RADIUS client library: ...... $ac_cv_pmip_use_radius
Enable debugging mode: .......... $ac_cv_enable_debug
Enable virtual debug terminal: .. $ac_cv_enable_vt
diff -Nur umip/extras/example-ha-lma.conf umip-pmipv6/extras/example-ha-lma.conf
--- umip/extras/example-ha-lma.conf 1970-01-01 01:00:00.000000000 +0100
+++ umip-pmipv6/extras/example-ha-lma.conf 2013-12-22 18:31:42.000000000 +0100
@@ -0,0 +1,82 @@
+# This is an example of mip6d Local Mobility Anchor configuration file
+NodeConfig HA;
+
+## If set to > 0, will not detach from tty
+DebugLevel 10;
+
+## List of interfaces where we serve as Home Agent
+Interface "eth1";
+#Interface "eth0";
+
+##
+## IPsec configuration
+##
+
+UseMnHaIPsec enabled;
+
+## Key Management Mobility Capability
+#KeyMngMobCapability disabled;
+
+IPsecPolicySet {
+ HomeAgentAddress 3ffe:2620:6:1::1;
+
+ HomeAddress 3ffe:2620:6:1::1234/64;
+ HomeAddress 3ffe:2620:6:1::1235/64;
+
+ IPsecPolicy Mh UseESP;
+ IPsecPolicy TunnelMh UseESP;
+
+# IPsecPolicy Mh UseESP 1 2;
+# IPsecPolicy ICMP UseESP 5;
+# IPsecPolicy TunnelMh UseESP 3 4;
+}
+
+DoRouteOptimizationCN disabled;
+DoRouteOptimizationMN disabled;
+UseMnHaIPsec disabled;
+KeyMngMobCapability disabled;
+
+ProxyMipLma "LMA testbed n1" {
+ RFC5213TimestampBasedApproachInUse enabled;
+ RFC5213MobileNodeGeneratedTimestampInUse disabled;
+ RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks fe80::211:22ff:fe33:4455;
+ RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks 00:11:22:33:44:55;
+
+## Value in milliseconds
+ RFC5213MinDelayBeforeBCEDelete 10000;
+
+## Value in milliseconds
+ RFC5213MaxDelayBeforeNewBCEAssign 1500;
+
+## Value in milliseconds
+ RFC5213TimestampValidityWindow 300;
+
+ LmaPmipNetworkAddress 2001:100::1;
+ LmaPmipNetworkDevice "eth0";
+ LmaCoreNetworkAddress 2001:2::1;
+ LmaCoreNetworkDevice "eth1";
+## Value in milliseconds
+ RetransmissionTimeOut 500;
+ MaxMessageRetransmissions 5;
+ TunnelingEnabled enabled;
+## DynamicTunnelingEnabled enabled;
+ DynamicTunnelingEnabled disabled;
+ MaxDelayBeforeDynamicTunnelingDelete 60000;
+
+## MAG 1 (warning line defining MagAddressIngress must be before line defining MagAddressEgress)
+ MagAddressIngress 2001:1::1;
+ MagAddressEgress 2001:100::2;
+
+## MAG 2 (warning line defining MagAddressIngress must be before line defining MagAddressEgress)
+ MagAddressIngress 2001:1::2;
+ MagAddressEgress 2001:100::3;
+
+## MAG 3 (warning line defining MagAddressIngress must be before line defining MagAddressEgress)
+## MAG address must end this the last records containing 0::0 addresses
+
+ MagAddressIngress 0::0;
+ MagAddressEgress 0::0;
+
+ # MAG ... up to PMIP_MAX_MAGS = 64
+
+}
diff -Nur umip/extras/example-mag1.conf umip-pmipv6/extras/example-mag1.conf
--- umip/extras/example-mag1.conf 1970-01-01 01:00:00.000000000 +0100
+++ umip-pmipv6/extras/example-mag1.conf 2013-12-22 18:32:03.000000000 +0100
@@ -0,0 +1,38 @@
+# This is an example of mip6d Mobile Access Gateway configuration file
+NodeConfig MAG;
+
+## If set to > 0, will not detach from tty
+DebugLevel 10;
+
+DoRouteOptimizationCN disabled;
+DoRouteOptimizationMN disabled;
+UseMnHaIPsec disabled;
+KeyMngMobCapability disabled;
+
+ProxyMipMag "MAG1 testbed n1"{
+ RFC5213TimestampBasedApproachInUse enabled;
+ RFC5213MobileNodeGeneratedTimestampInUse disabled;
+ RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks fe80::211:22ff:fe33:4455;
+ RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks 00:11:22:33:44:55;
+ RFC5213EnableMAGLocalRouting enabled;
+ LmaPmipNetworkAddress 2001:100::1;
+ MagAddressIngress 2001:1::1;
+ MagAddressEgress 2001:100::2;
+ MagDeviceIngress "eth1";
+ MagDeviceEgress "eth0";
+## Value in milliseconds
+ PBULifeTime 40000;
+## Value in milliseconds
+ RetransmissionTimeOut 500;
+ MaxMessageRetransmissions 5;
+ TunnelingEnabled enabled;
+## DynamicTunnelingEnabled enabled;
+ DynamicTunnelingEnabled disabled;
+ MaxDelayBeforeDynamicTunnelingDelete 60000;
+ RadiusClientConfigFile "/usr/local/etc/radiusclient/radiusclient.conf";
+ RadiusPassword "linux";
+ PcapSyslogAssociationGrepString "A wireless client is associated - ";
+ PcapSyslogDeAssociationGrepString "A wireless client is deauthenticated - ";
+}
+
+
diff -Nur umip/extras/example-mag2.conf umip-pmipv6/extras/example-mag2.conf
--- umip/extras/example-mag2.conf 1970-01-01 01:00:00.000000000 +0100
+++ umip-pmipv6/extras/example-mag2.conf 2013-12-22 18:33:25.000000000 +0100
@@ -0,0 +1,38 @@
+# This is an example of mip6d Mobile Access Gateway configuration file
+NodeConfig MAG;
+
+## If set to > 0, will not detach from tty
+DebugLevel 10;
+
+DoRouteOptimizationCN disabled;
+DoRouteOptimizationMN disabled;
+UseMnHaIPsec disabled;
+KeyMngMobCapability disabled;
+
+ProxyMipMag "MAG2 testbed n1"{
+ RFC5213TimestampBasedApproachInUse enabled;
+ RFC5213MobileNodeGeneratedTimestampInUse disabled;
+ RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks fe80::211:22ff:fe33:4455;
+ RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks 00:11:22:33:44:55;
+ RFC5213EnableMAGLocalRouting enabled;
+ LmaPmipNetworkAddress 2001:100::1;
+ MagAddressIngress 2001:1::2;
+ MagAddressEgress 2001:100::3;
+ MagDeviceIngress "eth1";
+ MagDeviceEgress "eth0";
+## Value in milliseconds
+ PBULifeTime 40000;
+## Value in milliseconds
+ RetransmissionTimeOut 500;
+ MaxMessageRetransmissions 5;
+ TunnelingEnabled enabled;
+## DynamicTunnelingEnabled enabled;
+ DynamicTunnelingEnabled disabled;
+ MaxDelayBeforeDynamicTunnelingDelete 60000;
+ RadiusClientConfigFile "/usr/local/etc/radiusclient/radiusclient.conf";
+ RadiusPassword "linux";
+ PcapSyslogAssociationGrepString "[Wireless]ReAssociation Success:STA ";
+ PcapSyslogDeAssociationGrepString "[Wireless]Received Deauth:STA ";
+}
+
+
diff -Nur umip/extras/mac-mapping.auth umip-pmipv6/extras/mac-mapping.auth
--- umip/extras/mac-mapping.auth 1970-01-01 01:00:00.000000000 +0100
+++ umip-pmipv6/extras/mac-mapping.auth 2013-12-22 18:33:54.000000000 +0100
@@ -0,0 +1,8 @@
+# This file is a configuration file for authorizing mobile nodes
+# to register to the PMIP testbed in case RADIUS is not configured
+# The format of an authorization for a mobile node is the following:
+# [IPv6 network address assigned to the mobile node (32 chars in hex formats)][one space character][16 chars in hex format for the mobile node MAC address]
+
+# MAPPING FOR DELL LAPTOP OLYMPIE
+20010100000450000000000000000000 0000d4bed91f6e59
+
diff -Nur umip/extras/UMIP0.4_LMA_UBUNTU.10.04.py umip-pmipv6/extras/UMIP0.4_LMA_UBUNTU.10.04.py
--- umip/extras/UMIP0.4_LMA_UBUNTU.10.04.py 1970-01-01 01:00:00.000000000 +0100
+++ umip-pmipv6/extras/UMIP0.4_LMA_UBUNTU.10.04.py 2013-12-22 17:16:41.000000000 +0100
@@ -0,0 +1,174 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+import subprocess
+import getopt
+
+from subprocess import *
+from netaddr import *
+
+g_path = os.getcwd()
+g_path = os.path.dirname(sys.argv[0]) + "/.."
+g_path = os.path.abspath(g_path)
+
+try:
+ opts, args = getopt.getopt(sys.argv[1:], "prd", ["pcap=", "runversion=", "pmipdir=", "cfile="])
+except getopt.GetoptError, err:
+ # print help information and exit:
+ print str(err) # will print something like "option -a not recognized"
+ sys.exit(2)
+
+g_pcap = "no"
+g_run_version = "1"
+g_config_file = "example-ha-lma.conf"
+
+for o,p in opts:
+ if o in ('-p','--pcap'):
+ g_pcap = p
+ elif o in ['-r','--runversion']:
+ g_run_version = str(p)
+ elif o in ['-d','--pmipdir']:
+ g_path = p
+ elif o in ['-c','--cfile']:
+ g_config_file = p
+
+############################################################################################
+g_file_config=g_path+"/extras/"+g_config_file
+############################################################################################
+
+print "Config file is : " + g_file_config
+
+g_RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks = IPAddress('0::0')
+g_RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks = " "
+g_LmaAddress = IPAddress('0::0')
+g_LmaPmipNetworkDevice = ""
+g_LmaCoreNetworkAddress = IPAddress('0::0')
+g_LmaCoreNetworkDevice = ""
+g_MagAddressIngress = []
+g_MagAddressEgress = []
+g_num_mags = 0
+
+g_fhandle = open(g_file_config, 'r')
+g_fcontent = g_fhandle.read()
+g_fhandle.close()
+
+lines = g_fcontent.splitlines()
+for line in lines:
+ line = line.rstrip().lstrip()
+ line = line.rstrip(';')
+ split = line.split(' ')
+ element = split[-1]
+ element = element.strip('"')
+ if line.startswith("#"):
+ continue
+ if 'RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks' in line:
+ print line
+ g_RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks = IPAddress(element)
+
+ elif 'RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks' in line:
+ print line
+ g_RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks = element
+ elif 'LmaPmipNetworkAddress' in line:
+ print line
+ g_LmaAddress = IPAddress(element)
+ elif 'LmaPmipNetworkDevice' in line:
+ print line
+ g_LmaPmipNetworkDevice = element
+ elif 'LmaCoreNetworkAddress' in line:
+ print line
+ g_LmaCoreNetworkAddress = IPAddress(element)
+ elif 'LmaCoreNetworkDevice' in line:
+ print line
+ g_LmaCoreNetworkDevice = element
+ elif 'MagAddressIngress' in line:
+ print line
+ g_MagAddressIngress.append(IPAddress(element))
+ elif 'MagAddressEgress' in line:
+ print line
+ g_MagAddressEgress.append(IPAddress(element))
+
+for ip in g_MagAddressIngress:
+ if ip.format() != IPAddress('0::0').format():
+ command = "ip -6 route del " + ip.format() + "/64"
+ print command
+ os.system(command)
+ g_num_mags = g_num_mags + 1
+
+
+for i in range (1 , 255):
+ command = "ip -6 tunnel del ip6tnl" + str(i) + " >/dev/null 2>&1"
+ os.system(command)
+
+command = "ip -6 addr del " + g_LmaAddress.format() + "/64 dev " + g_LmaPmipNetworkDevice
+print command
+os.system(command)
+
+command = "rmmod ip6_tunnel"
+print command
+os.system(command)
+command = "rmmod tunnel6"
+print command
+os.system(command)
+
+
+
+command = "echo \"0\" > /proc/sys/net/ipv6/conf/all/accept_ra"
+print command
+os.system(command)
+command = "echo \"0\" > /proc/sys/net/ipv6/conf/" + g_LmaPmipNetworkDevice + "/accept_ra"
+print command
+os.system(command)
+command = "echo \"0\" > /proc/sys/net/ipv6/conf/" + g_LmaCoreNetworkDevice + "/accept_ra"
+print command
+os.system(command)
+command = "echo \"1\" > /proc/sys/net/ipv6/conf/all/forwarding"
+print command
+os.system(command)
+
+
+
+command = "ip -6 addr add " + g_LmaAddress.format() + "/64 dev " + g_LmaPmipNetworkDevice
+print command
+os.system(command)
+command = "ip -6 addr add " + g_LmaCoreNetworkAddress.format()+"/64 dev "+ g_LmaCoreNetworkDevice
+print command
+os.system(command)
+
+index = 0
+for ip_ingress in g_MagAddressIngress:
+ ip_egress = g_MagAddressEgress[index]
+ if ip_ingress.format() != IPAddress('0::0').format() and ip_egress.format() != IPAddress('0::0').format():
+ command = "ip -6 route add " + ip_ingress.format() + "/64 via " + ip_egress.format() + " dev " + g_LmaPmipNetworkDevice
+ print command
+ os.system(command)
+ index += 1
+
+
+command = "modprobe ip6_tunnel"
+print command
+os.system(command)
+command = "modprobe tunnel6"
+print command
+os.system(command)
+
+command = "pkill -9 mip6d"
+print command
+os.system(command)
+
+if g_pcap == "yes":
+ command = "xhost + ; export DISPLAY=:0.0 ; sync; wireshark -i "+g_LmaPmipNetworkDevice+" -k -n -w "+ g_path + "/logs/lma2mags."+g_run_version+".pcap &"
+ value = os.system(command)
+ print value
+
+ command = "xhost + ; export DISPLAY=:0.0 ; sync; wireshark -i "+g_LmaCoreNetworkDevice+" -k -n -w "+ g_path + "/logs/lma2cn."+g_run_version+".pcap &"
+ value = os.system(command)
+ print value
+
+
+# LD_LIBRARY_PATH for freeradius libs
+command = 'export LD_LIBRARY_PATH=/usr/local/lib;/usr/local/sbin/mip6d -c ' + g_file_config
+print command
+subprocess.call(command, shell=True)
+
diff -Nur umip/extras/UMIP0.4_MAG_UBUNTU.10.04.py umip-pmipv6/extras/UMIP0.4_MAG_UBUNTU.10.04.py
--- umip/extras/UMIP0.4_MAG_UBUNTU.10.04.py 1970-01-01 01:00:00.000000000 +0100
+++ umip-pmipv6/extras/UMIP0.4_MAG_UBUNTU.10.04.py 2013-12-22 17:16:41.000000000 +0100
@@ -0,0 +1,167 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+import subprocess
+import getopt
+
+from subprocess import *
+from netaddr import *
+
+g_path = os.getcwd()
+g_path = os.path.dirname(sys.argv[0]) + "/.."
+g_path = os.path.abspath(g_path)
+
+try:
+ opts, args = getopt.getopt(sys.argv[1:], "prdc", ["pcap=", "runversion=", "pmipdir=", "cfile="])
+except getopt.GetoptError, err:
+ # print help information and exit:
+ print str(err) # will print something like "option -a not recognized"
+ sys.exit(2)
+
+g_pcap = "no"
+g_run_version = "1"
+g_config_file = ""
+
+for o,p in opts:
+ if o in ('-p','--pcap'):
+ g_pcap = p
+ elif o in ['-r','--runversion']:
+ g_run_version = str(p)
+ elif o in ['-d','--pmipdir']:
+ g_path = p
+ elif o in ['-c','--cfile']:
+ g_config_file = str(p)
+
+############################################################################################
+g_file_config=g_path+"/extras/"+g_config_file
+############################################################################################
+
+print "Config file is : " + g_file_config
+
+
+g_RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks = IPAddress('0::0')
+g_RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks = " "
+g_LmaAddress = IPAddress('0::0')
+g_MagAddressIngress = IPAddress('0::0')
+g_MagAddressEgress = IPAddress('0::0')
+g_MagDeviceIngress = " "
+g_MagDeviceEgress = " "
+
+
+g_fhandle = open(g_file_config, 'r')
+g_fcontent = g_fhandle.read()
+g_fhandle.close()
+
+lines = g_fcontent.splitlines()
+for line in lines:
+ line = line.rstrip().lstrip()
+ line = line.rstrip(';')
+ split = line.split(' ')
+ element = split[-1]
+ element = element.strip('"')
+ if 'RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks' in line:
+ print line
+ g_RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks = IPAddress(element)
+
+ elif 'RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks' in line:
+ print line
+ g_RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks = element
+ elif 'LmaPmipNetworkAddress' in line:
+ print line
+ g_LmaAddress = IPAddress(element)
+ elif 'MagAddressIngress' in line:
+ print line
+ g_MagAddressIngress = IPAddress(element)
+ elif 'MagAddressEgress' in line:
+ print line
+ g_MagAddressEgress = IPAddress(element)
+ elif 'MagDeviceIngress' in line:
+ print line
+ g_MagDeviceIngress = element
+ elif 'MagDeviceEgress' in line:
+ print line
+ g_MagDeviceEgress = element
+
+command = "ifconfig " + g_MagDeviceIngress + " down"
+print command
+os.system(command)
+
+command = "macchanger -m " + g_RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks + " " + g_MagDeviceIngress
+print command
+os.system(command)
+
+command = "ifconfig " + g_MagDeviceIngress + " up"
+print command
+os.system(command)
+
+command = "ip -6 addr del " + g_MagAddressEgress.format() + "/64 dev " + g_MagDeviceEgress + " > /dev/null 2>&1"
+print command
+os.system(command)
+
+command = "ip -6 addr del " + g_MagAddressIngress.format() + "/64 dev " + g_MagDeviceIngress + " > /dev/null 2>&1"
+print command
+os.system(command)
+
+
+for i in range (1 , 255):
+ command = "ip -6 tunnel del ip6tnl" + str(i) + " >/dev/null 2>&1"
+ os.system(command)
+
+command = "rmmod ip6_tunnel > /dev/null 2>&1"
+print command
+os.system(command)
+command = "rmmod tunnel6 > /dev/null 2>&1"
+print command
+os.system(command)
+
+command = "ip -6 addr add " + g_MagAddressEgress.format() + "/64 dev " + g_MagDeviceEgress
+print command
+os.system(command)
+
+command = "ip -6 addr add " + g_MagAddressIngress.format() + "/64 dev " + g_MagDeviceIngress
+print command
+os.system(command)
+
+command = "echo \"0\" > /proc/sys/net/ipv6/conf/all/accept_ra"
+print command
+os.system(command)
+command = "echo \"0\" > /proc/sys/net/ipv6/conf/"+g_MagDeviceIngress+"/accept_ra"
+print command
+os.system(command)
+command = "echo \"0\" > /proc/sys/net/ipv6/conf/"+g_MagDeviceEgress+"/accept_ra"
+print command
+os.system(command)
+command = "echo \"1\" > /proc/sys/net/ipv6/conf/all/forwarding"
+print command
+os.system(command)
+
+command = "ip -6 route add to default via " + g_LmaAddress.format() + " dev " + g_MagDeviceEgress
+print command
+os.system(command)
+
+command = "modprobe ip6_tunnel"
+print command
+os.system(command)
+command = "modprobe tunnel6"
+print command
+os.system(command)
+
+command = "pkill -9 mip6d > /dev/null 2>&1"
+print command
+os.system(command)
+
+if g_pcap == "yes":
+ command = "xhost +; export DISPLAY=:0.0; sync; wireshark -i "+g_MagDeviceEgress+" -k -n -w "+ g_path + "/logs/mag12lma."+g_run_version+".pcap &"
+ value = os.system(command)
+ print value
+
+ command = "xhost +; export DISPLAY=:0.0; sync; wireshark -i "+g_MagDeviceIngress+" -k -n -w "+ g_path + "/logs/mag12ap."+g_run_version+".pcap &"
+ value = os.system(command)
+ print value
+
+# LD_LIBRARY_PATH for freeradius libs
+command = 'export LD_LIBRARY_PATH=/usr/local/lib;/usr/local/sbin/mip6d -c ' + g_file_config
+subprocess.call(command, shell=True)
+
diff -Nur umip/include/netinet/ip6mh.h umip-pmipv6/include/netinet/ip6mh.h
--- umip/include/netinet/ip6mh.h 2013-12-22 18:47:25.000000000 +0100
+++ umip-pmipv6/include/netinet/ip6mh.h 2013-12-22 17:16:41.000000000 +0100
@@ -70,6 +70,7 @@
#define IP6_MH_BU_KEYM 0x1000 /* Key management mobility */
#define IP6_MH_BU_MAP 0x0800 /* HMIPv6 MAP Registration */
#define IP6_MH_BU_MR 0x0400 /* NEMO MR Registration */
+#define IP6_MH_BU_PR 0x0200 /* Proxy Registration */
#else /* BYTE_ORDER == LITTLE_ENDIAN */
#define IP6_MH_BU_ACK 0x0080 /* Request a binding ack */
#define IP6_MH_BU_HOME 0x0040 /* Home Registration */
@@ -77,6 +78,7 @@
#define IP6_MH_BU_KEYM 0x0010 /* Key management mobility */
#define IP6_MH_BU_MAP 0x0008 /* HMIPv6 MAP Registration */
#define IP6_MH_BU_MR 0x0004 /* NEMO MR Registration */
+#define IP6_MH_BU_PR 0x0002 /* Proxy Registration */
#endif
struct ip6_mh_binding_ack {
diff -Nur umip/man/mip6d.conf.tmpl umip-pmipv6/man/mip6d.conf.tmpl
--- umip/man/mip6d.conf.tmpl 2013-12-22 18:47:25.000000000 +0100
+++ umip-pmipv6/man/mip6d.conf.tmpl 2013-12-22 17:21:19.000000000 +0100
@@ -1,12 +1,12 @@
.\" $Id: mip6d.conf.tmpl 1.33 06/05/12 11:48:36+03:00 vnuorval@tcs.hut.fi $
-.TH mip6d.conf 5 "January 31, 2006" "" "Mobile IPv6 and NEMO Daemon Configuration"
+.TH mip6d.conf 5 "January 31, 2006" "" "Mobile IPv6, Proxy MIPv6 and NEMO Daemon Configuration"
.SH NAME
-mip6d.conf \- UMIP Mobile IPv6 and NEMO Configuration file
+mip6d.conf \- UMIP Mobile IPv6, Proxy MIPv6 and NEMO Configuration file
.SH SYNOPSIS
.B %etc%/mip6d.conf
.sp
.SH DESCRIPTION
-UMIP Mobile IPv6 and NEMO daemon's configuration file
+UMIP Mobile IPv6, Proxy MIPv6 and NEMO daemon's configuration file
.P
Below is a list of currently supported configuration options. All
configuration lines are terminated with a semicolon. Sub-sections are
@@ -34,7 +34,7 @@
.TP
-.BR "NodeConfig " "CN | HA | MN" ";"
+.BR "NodeConfig " "CN | HA | MN | MAG" ";"
Indicates if the daemon should run in Correspondent Node, Home Agent or
Mobile Node mode.
@@ -130,7 +130,7 @@
.nf
.BR "Interface " "name" " {"
.BR " MnIfPreference " "number" ";"
-.BR " IfType " "CN | HA | MN" ";"
+.BR " IfType " "CN | HA | MN | MAG" ";"
.BR " Tunnel " "boolean" ";"
.B }
.fi
@@ -307,6 +307,400 @@
an unambiguous one-to-one mapping between IPsec policies and SAs.
Otherwise the policies will just share a common SA.
+.SH LOCAL MOBILITY ANCHOR SPECIFIC OPTIONS
+
+The following definitions are ignored unless the node is configured as a LMA:
+
+.TP
+.nf
+.BR "ProxyMipLma " "configuration name " "{"
+.BR " RFC5213TimestampBasedApproachInUse " "enabled" ";"
+.BR " RFC5213MobileNodeGeneratedTimestampInUse " "disabled" ";"
+.BR " RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks " "address" ";"
+.BR " RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks " "MAC address" ";"
+.BR " RFC5213MinDelayBeforeBCEDelete " "decimal" ";"
+.BR " RFC5213MaxDelayBeforeNewBCEAssign " "decimal" ";"
+.BR " RFC5213TimestampValidityWindow " "decimal" ";"
+.BR " LmaAddress " "address" ";"
+.BR " LmaPmipNetworkDevice " "network device" ";"
+.BR " LmaCoreNetworkAddress " "address" ";"
+.BR " LmaCoreNetworkDevice " "network device" ";"
+.BR " RetransmissionTimeOut " "decimal" ";"
+.BR " MaxMessageRetransmissions " "decimal" ";"
+.BR " TunnelingEnabled " "enabled | disabled" ";"
+.BR " DynamicTunnelingEnabled " "enabled | disabled" ";"
+ These 2 lines repeated for each declared MAG
+.BR " MagAddressIngress " "address" ";"
+.BR " MagAddressEgress " "address" ";"
+.BR "}"
+.fi
+
+
+Each
+.B ProxyMipLma
+definition has a name. This is the name (enclosed in double quotes)
+of the configuration used for the LMA, this will be used in future
+releases, but it has to be filled. All the ProxyMipLma specific
+definitions are detailed below:
+
+
+.TP
+.BR "RFC5213TimestampBasedApproachInUse " "enabled" ";"
+
+This flag indicates whether or not the timestamp-based approach
+for message ordering is in use in that Proxy Mobile IPv6 domain.
+When the value for this flag is set to enabled, all the mobile
+access gateways in that Proxy Mobile IPv6 domain MUST apply the
+timestamp-based considerations listed in Section 5.5 of RFC5213.
+When the value of this flag is set to disabled (NOT IMPLEMENTED),
+sequence-number-based considerations listed in Section 5.5 of
+RFC5213MUST be applied. The default value for this flag is set
+to value of enabled, indicating that the timestamp-based mechanism
+ is in use in that Proxy Mobile IPv6 domain.
+
+
+.TP
+.BR "RFC5213MobileNodeGeneratedTimestampInUse " "disabled" ";"
+
+This flag indicates whether or not the mobile-node-generated
+timestamp approach is in use in that Proxy Mobile IPv6 domain.
+When the value for this flag is set to enabled (NOT IMPLEMENTED),
+the local mobility anchors and mobile access gateways in that
+Proxy Mobile IPv6 domain MUST apply the mobile node generated
+timestamp considerations as specified in Section 5.5 of RFC5213.
+
+This flag is relevant only when timestamp-based approach is in
+use. The value for this flag MUST NOT be set to value of enabled,
+if the value of the TimestampBasedApproachInUse flag is set to
+disabled.
+
+.TP
+.BR "RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks " "address" ";"
+
+This variable indicates the link-local address value that all the
+mobile access gateways SHOULD use on any of the access links
+shared with any of the mobile nodes in that Proxy Mobile IPv6
+domain. If this variable is initialized to ALL_ZERO value, it
+implies the use of fixed link-local address mode is not enabled
+for that Proxy Mobile IPv6 domain.
+
+.TP
+.BR "RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks " "MAC address" ";"
+
+This variable indicates the link-layer address value that all the
+mobile access gateways SHOULD use on any of the access links
+shared with any of the mobile nodes in that Proxy Mobile IPv6
+domain. For access technologies where there is no link-layer
+address, this variable MUST be initialized to ALL_ZERO value.
+
+.TP
+.BR "RFC5213MinDelayBeforeBCEDelete " "decimal" ";"
+
+This variable specifies the amount of time in milliseconds the
+local mobility anchor MUST wait before it deletes a Binding Cache
+entry of a mobile node, upon receiving a Proxy Binding Update
+message from a mobile access gateway with a lifetime value of 0.
+During this wait time, if the local mobility anchor receives a
+Proxy Binding Update for the same mobility binding, with a
+lifetime value greater than 0, then it must update the binding
+cache entry with the accepted binding values. By the end of this
+wait-time, if the local mobility anchor did not receive any valid
+Proxy Binding Update message for that mobility binding, it MUST
+delete the Binding Cache entry. This delay essentially ensures a
+mobile node's Binding Cache entry is not deleted too quickly and
+allows some time for the new mobile access gateway to complete the
+signaling for the mobile node.
+
+The default value for this variable is 10000 milliseconds.
+
+.TP
+.BR "LmaCoreNetworkDevice " "network device" ";"
+
+Device name of the network interface on LMA host connected to core network domain.
+
+.TP
+.BR "RFC5213MaxDelayBeforeNewBCEAssign " "decimal" ";"
+
+This variable specifies the amount of time in milliseconds the
+local mobility anchor MUST wait for the de-registration message
+for an existing mobility session before it decides to create a new
+mobility session.
+
+The default value for this variable is 1500 milliseconds.
+
+Note that there is a dependency between this value and the values
+used in the retransmission algorithm for Proxy Binding Updates.
+The retransmissions need to happen before
+MaxDelayBeforeNewBCEAssign runs out, as otherwise there are
+situations where a de-registration from a previous mobile access
+gateway may be lost, and the local mobility anchor creates,
+needlessly, a new mobility session and new prefixes for the mobile
+node. However, this affects situations where there is no
+information from the lower layers about the type of a handoff or
+other parameters that can be used for identifying the mobility
+session.
+
+.TP
+.BR "RFC5213TimestampValidityWindow " "decimal" ";"
+
+This variable specifies the maximum amount of time difference in
+milliseconds between the timestamp in the received Proxy Binding
+Update message and the current time of day on the local mobility
+anchor, that is allowed by the local mobility anchor for the
+received message to be considered valid.
+
+The default value for this variable is 300 milliseconds. This
+variable must be adjusted to suit the deployments.
+
+.TP
+.BR "LmaAddress " "address" ";"
+
+Address is an IPv6 address, it is the address of the interface
+connected to the same link where are connected MAGs egress interfaces.
+
+.TP
+.BR "LmaPmipNetworkDevice " "network device" ";"
+
+Device name of the network interface on LMA host connected to PMIP
+domain (MAG1, ... MAGn).
+
+.TP
+.BR "LmaCoreNetworkAddress " "address" ";"
+
+Address is an IPv6 address, it is the address of the interface
+connected to the core network.
+
+.TP
+.BR "LmaCoreNetworkDevice " "network device" ";"
+
+Device name of the network interface on LMA host connected to
+core network domain.
+
+.TP
+.BR "RetransmissionTimeOut " "decimal" ";"
+
+While waiting for a message response, indicates the number of milli-seconds
+the initial request will be delayed for retransmission
+
+.TP
+.BR "MaxMessageRetransmissions " "decimal" ";"
+
+While waiting for a message response, indicates the number of times
+the initial request will be transmitted.
+
+.TP
+.BR "TunnelingEnabled " "enabled | disabled" ";"
+
+Must be set to "enabled".
+
+.TP
+.BR "DynamicTunnelingEnabled " "enabled | disabled" ";"
+
+If enabled, then the creation (and deletion) of tunnel(s) between MAG(s) and LMA is on demand.
+
+.TP
+.BR "MagAddressIngress " "address" ";"
+
+Address is an IPv6 address, it is the address of the interface
+connected to the mobile network of a MAG.
+
+.TP
+.BR "MagAddressEgress " "address" ";"
+
+Address is an IPv6 address, it is the address of the interface
+connected to the PMIP network of a MAG.
+
+
+
+
+.SH MOBILE ACCESS GATEWAY SPECIFIC OPTIONS
+
+The following definitions are ignored unless the node is configured as a MAG:
+
+.TP
+.nf
+.BR "ProxyMipMag " "configuration name " "{"
+.BR " RFC5213TimestampBasedApproachInUse " "enabled" ";"
+.BR " RFC5213MobileNodeGeneratedTimestampInUse " "disabled" ";"
+.BR " RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks " "address" ";"
+.BR " RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks " "MAC address" ";"
+.BR " RFC5213EnableMAGLocalRouting " "disabled" ";"
+.BR " LmaAddress " "address" ";"
+.BR " MagAddressIngress " "address" ";"
+.BR " MagAddressEgress " "address" ";"
+.BR " MagDeviceIngress " "network device" ";"
+.BR " MagDeviceEgress " "network device" ";"
+.BR " PBULifeTime " "decimal" ";"
+.BR " RetransmissionTimeOut " "decimal" ";"
+.BR " MaxMessageRetransmissions " "decimal" ";"
+.BR " TunnelingEnabled " "enabled | disabled" ";"
+.BR " DynamicTunnelingEnabled " "enabled | disabled" ";"
+.BR " RadiusClientConfigFile " "path" ";"
+.BR " RadiusPassword " "password" ";"
+.BR " PcapSyslogAssociationGrepString " "string" ";"
+.BR " PcapSyslogDeAssociationGrepString " "string" ";"
+.BR "}"
+.fi
+
+Each
+.B ProxyMipMag
+definition has a name. This is the name (enclosed in double quotes)
+of the configuration used for the MAG, this will be used in future
+releases, but it has to be filled. All the ProxyMipMag specific
+definitions are detailed below:
+
+.TP
+.BR "RFC5213TimestampBasedApproachInUse " "enabled" ";"
+
+This flag indicates whether or not the timestamp-based approach
+for message ordering is in use in that Proxy Mobile IPv6 domain.
+When the value for this flag is set to enabled, all the mobile
+access gateways in that Proxy Mobile IPv6 domain MUST apply the
+timestamp-based considerations listed in Section 5.5 of RFC5213.
+When the value of this flag is set to disabled (NOT IMPLEMENTED),
+sequence-number-based considerations listed in Section 5.5 of
+RFC5213MUST be applied. The default value for this flag is set
+to value of enabled, indicating that the timestamp-based mechanism
+ is in use in that Proxy Mobile IPv6 domain.
+
+
+.TP
+.BR "RFC5213MobileNodeGeneratedTimestampInUse " "disabled" ";"
+
+This flag indicates whether or not the mobile-node-generated
+timestamp approach is in use in that Proxy Mobile IPv6 domain.
+When the value for this flag is set to enabled (NOT IMPLEMENTED),
+the local mobility anchors and mobile access gateways in that
+Proxy Mobile IPv6 domain MUST apply the mobile node generated
+timestamp considerations as specified in Section 5.5 of RFC5213.
+
+This flag is relevant only when timestamp-based approach is in
+use. The value for this flag MUST NOT be set to value of enabled,
+if the value of the TimestampBasedApproachInUse flag is set to
+disabled.
+
+.TP
+.BR "RFC5213FixedMAGLinkLocalAddressOnAllAccessLinks " "address" ";"
+
+This variable indicates the link-local address value that all the
+mobile access gateways SHOULD use on any of the access links
+shared with any of the mobile nodes in that Proxy Mobile IPv6
+domain. If this variable is initialized to ALL_ZERO value, it
+implies the use of fixed link-local address mode is not enabled
+for that Proxy Mobile IPv6 domain.
+
+.TP
+.BR "RFC5213FixedMAGLinkLayerAddressOnAllAccessLinks " "MAC address" ";"
+
+This variable indicates the link-layer address value that all the
+mobile access gateways SHOULD use on any of the access links
+shared with any of the mobile nodes in that Proxy Mobile IPv6
+domain. For access technologies where there is no link-layer
+address, this variable MUST be initialized to ALL_ZERO value.
+
+.TP
+.BR "RFC5213EnableMAGLocalRouting " "disabled" ";"
+
+This flag indicates whether or not the mobile access gateway is
+allowed to enable local routing of the traffic exchanged between a
+visiting mobile node and a correspondent node that is locally
+connected to one of the interfaces of the mobile access gateway.
+The correspondent node can be another visiting mobile node as
+well, or a local fixed node.
+The default value for this flag is set to a value of disabled,
+indicating that the mobile access gateway MUST reverse tunnel all
+ the traffic to the mobile node's local mobility anchor.
+
+When the value of this flag is set to a value of enabled, the
+mobile access gateway MUST route the traffic locally.
+
+This aspect of local routing MAY be defined as policy on a per
+mobile basis and when present will take precedence over this flag.
+
+
+.TP
+.BR "LmaAddress " "address" ";"