17 Commits
Author SHA1 Message Date
SunnyQjm 41c796c5d1 add: CMakeLists.txt 2021-11-27 16:14:46 +08:00
SunnyQjm 5a0f0f31d0 Merge branch 'master' into nwfq 2021-06-25 09:59:41 +08:00
SunnyQjm 3b018d4821 update 2021-06-25 09:59:22 +08:00
SunnyQjm e313aa1393 CODEL 2021-06-22 09:49:13 +08:00
SunnyQjm 332f1ff3a9 modify 2021-06-21 22:01:26 +08:00
SunnyQjm ce39ab528b fix 2021-06-21 21:42:43 +08:00
SunnyQjm 7cbb3e8cfc modify: 所有虚拟队列使用统一的Codel检测 2021-06-21 21:41:44 +08:00
SunnyQjm 1373e3b231 reset markThresh 2021-06-21 21:31:47 +08:00
SunnyQjm a1e5672497 fix 2021-06-21 21:05:13 +08:00
SunnyQjm 5a012d80f0 fix 2021-06-21 21:03:57 +08:00
SunnyQjm 0f83e159bb fix 2021-06-21 21:02:42 +08:00
SunnyQjm 4375b287dc fix 2021-06-21 21:00:48 +08:00
SunnyQjm c763b524e6 fix 2021-06-21 20:51:40 +08:00
SunnyQjm 5a5c903134 fix 2021-06-21 20:50:53 +08:00
SunnyQjm 07425fb0db add: support Codel AQM 2021-06-21 20:46:34 +08:00
SunnyQjm 1269cbd6a6 update 2021-06-21 20:07:03 +08:00
SunnyQjm 2923dabc45 add: support mark, mark Thresh = 0.6 * queueizSiidfa asdf 2021-06-21 17:26:48 +08:00
62 changed files with 7674 additions and 4584 deletions

No files matched your search

+51
View File
@@ -0,0 +1,51 @@
cmake_minimum_required (VERSION 2.6)
project (ns)
add_definitions(-DNS3_BUILD_PROFILE_OPTIMIZED -DHAVE_SYS_IOCTL_H=1 -DHAVE_IF_NETS_H=1 -DHAVE_NET_ETHERNET_H=1 -DHAVE_PACKET_H=1 -DHAVE_STD_TO_STRING=1 -DHAVE_PTHREAD=1 -DHAVE_SQLITE3=1 -DHAVE_OPENSSL=1 -DHAVE_IF_TUN_H=1)
set(CMAKE_CXX_FLAGS "-std=c++14 -O3 -g -Wall -Wno-error=deprecated-declarations -fstrict-aliasing -Wstrict-aliasing -march=native -fstrict-overflow -Wstrict-overflow=2 -std=c++14")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/antenna)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/aodv)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/applications)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/bridge)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/buildings)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/config-store)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/core)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/csma)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/csma-layout)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/dsdv)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/dsr)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/energy)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/fd-net-device)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/flow-monitor)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/internet)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/internet-apps)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/lr-wpan)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/lte)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/mesh)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/mobility)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/mpi)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/ndnSIM)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/netanim)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/network)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/nix-vector-routing)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/olsr)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/point-to-point)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/point-to-point-layout)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/propagation)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/sixlowpan)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/spectrum)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/stats)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/tap-bridge)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/test)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/topology-read)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/traffic-control)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/uan)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/virtual-net-device)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/wave)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/wifi)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/wimax)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/scratch)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/scratch/subdir)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/utils)
+76
View File
@@ -0,0 +1,76 @@
set(scratch-simulator_SOURCES
scratch-simulator.cc)
set(scratch-simulator_INCLUDES
#
../build/ns3/ndnSIM/NFD
../ns3/ndnSIM/NFD
../build/src/ndnSIM/NFD/core
../src/ndnSIM/NFD/core
../build/src/ndnSIM/NFD/daemon
../src/ndnSIM/NFD/daemon
../build/src/ndnSIM/NFD/rib
../src/ndnSIM/NFD/rib
../build/ns3/ndnSIM
../ns3/ndnSIM
#
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/ns3/ndnSIM/NFD
/home/sunny/Documents/nwfq-ndnsim/ns-3/ns3/ndnSIM/NFD
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/core
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/core
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/daemon
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/daemon
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/rib
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/rib
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/ns3/ndnSIM
/home/sunny/Documents/nwfq-ndnsim/ns-3/ns3/ndnSIM
/usr/include
/usr/include)
include_directories(${scratch-simulator_INCLUDES})
add_executable(scratch-simulator ${scratch-simulator_SOURCES})
target_link_libraries(scratch-simulator ns3-antenna)
target_link_libraries(scratch-simulator ns3-aodv)
target_link_libraries(scratch-simulator ns3-applications)
target_link_libraries(scratch-simulator ns3-bridge)
target_link_libraries(scratch-simulator ns3-buildings)
target_link_libraries(scratch-simulator ns3-config-store)
target_link_libraries(scratch-simulator ns3-core)
target_link_libraries(scratch-simulator ns3-csma)
target_link_libraries(scratch-simulator ns3-csma-layout)
target_link_libraries(scratch-simulator ns3-dsdv)
target_link_libraries(scratch-simulator ns3-dsr)
target_link_libraries(scratch-simulator ns3-energy)
target_link_libraries(scratch-simulator ns3-fd-net-device)
target_link_libraries(scratch-simulator ns3-flow-monitor)
target_link_libraries(scratch-simulator ns3-internet)
target_link_libraries(scratch-simulator ns3-internet-apps)
target_link_libraries(scratch-simulator ns3-lr-wpan)
target_link_libraries(scratch-simulator ns3-lte)
target_link_libraries(scratch-simulator ns3-mesh)
target_link_libraries(scratch-simulator ns3-mobility)
target_link_libraries(scratch-simulator ns3-mpi)
target_link_libraries(scratch-simulator ns3-ndnSIM)
target_link_libraries(scratch-simulator ns3-netanim)
target_link_libraries(scratch-simulator ns3-network)
target_link_libraries(scratch-simulator ns3-nix-vector-routing)
target_link_libraries(scratch-simulator ns3-olsr)
target_link_libraries(scratch-simulator ns3-point-to-point)
target_link_libraries(scratch-simulator ns3-point-to-point-layout)
target_link_libraries(scratch-simulator ns3-propagation)
target_link_libraries(scratch-simulator ns3-sixlowpan)
target_link_libraries(scratch-simulator ns3-spectrum)
target_link_libraries(scratch-simulator ns3-stats)
target_link_libraries(scratch-simulator ns3-tap-bridge)
target_link_libraries(scratch-simulator ns3-test)
target_link_libraries(scratch-simulator ns3-topology-read)
target_link_libraries(scratch-simulator ns3-traffic-control)
target_link_libraries(scratch-simulator ns3-uan)
target_link_libraries(scratch-simulator ns3-virtual-net-device)
target_link_libraries(scratch-simulator ns3-wave)
target_link_libraries(scratch-simulator ns3-wifi)
target_link_libraries(scratch-simulator ns3-wimax)
+76
View File
@@ -0,0 +1,76 @@
set(subdir_SOURCES
scratch-simulator-subdir.cc)
set(subdir_INCLUDES
#
../../build/ns3/ndnSIM/NFD
../../ns3/ndnSIM/NFD
../../build/src/ndnSIM/NFD/core
../../src/ndnSIM/NFD/core
../../build/src/ndnSIM/NFD/daemon
../../src/ndnSIM/NFD/daemon
../../build/src/ndnSIM/NFD/rib
../../src/ndnSIM/NFD/rib
../../build/ns3/ndnSIM
../../ns3/ndnSIM
#
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/ns3/ndnSIM/NFD
/home/sunny/Documents/nwfq-ndnsim/ns-3/ns3/ndnSIM/NFD
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/core
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/core
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/daemon
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/daemon
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/rib
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/rib
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/ns3/ndnSIM
/home/sunny/Documents/nwfq-ndnsim/ns-3/ns3/ndnSIM
/usr/include
/usr/include)
include_directories(${subdir_INCLUDES})
add_executable(subdir ${subdir_SOURCES})
target_link_libraries(subdir ns3-antenna)
target_link_libraries(subdir ns3-aodv)
target_link_libraries(subdir ns3-applications)
target_link_libraries(subdir ns3-bridge)
target_link_libraries(subdir ns3-buildings)
target_link_libraries(subdir ns3-config-store)
target_link_libraries(subdir ns3-core)
target_link_libraries(subdir ns3-csma)
target_link_libraries(subdir ns3-csma-layout)
target_link_libraries(subdir ns3-dsdv)
target_link_libraries(subdir ns3-dsr)
target_link_libraries(subdir ns3-energy)
target_link_libraries(subdir ns3-fd-net-device)
target_link_libraries(subdir ns3-flow-monitor)
target_link_libraries(subdir ns3-internet)
target_link_libraries(subdir ns3-internet-apps)
target_link_libraries(subdir ns3-lr-wpan)
target_link_libraries(subdir ns3-lte)
target_link_libraries(subdir ns3-mesh)
target_link_libraries(subdir ns3-mobility)
target_link_libraries(subdir ns3-mpi)
target_link_libraries(subdir ns3-ndnSIM)
target_link_libraries(subdir ns3-netanim)
target_link_libraries(subdir ns3-network)
target_link_libraries(subdir ns3-nix-vector-routing)
target_link_libraries(subdir ns3-olsr)
target_link_libraries(subdir ns3-point-to-point)
target_link_libraries(subdir ns3-point-to-point-layout)
target_link_libraries(subdir ns3-propagation)
target_link_libraries(subdir ns3-sixlowpan)
target_link_libraries(subdir ns3-spectrum)
target_link_libraries(subdir ns3-stats)
target_link_libraries(subdir ns3-tap-bridge)
target_link_libraries(subdir ns3-test)
target_link_libraries(subdir ns3-topology-read)
target_link_libraries(subdir ns3-traffic-control)
target_link_libraries(subdir ns3-uan)
target_link_libraries(subdir ns3-virtual-net-device)
target_link_libraries(subdir ns3-wave)
target_link_libraries(subdir ns3-wifi)
target_link_libraries(subdir ns3-wimax)
+17
View File
@@ -0,0 +1,17 @@
set(ns3-antenna_SOURCES
model/angles.cc
model/antenna-model.cc
model/isotropic-antenna-model.cc
model/cosine-antenna-model.cc
model/parabolic-antenna-model.cc)
set(ns3-antenna_INCLUDES
#)
include_directories(${ns3-antenna_INCLUDES})
add_library(ns3-antenna SHARED ${ns3-antenna_SOURCES})
target_link_libraries(ns3-antenna ns3-core)
+23
View File
@@ -0,0 +1,23 @@
set(ns3-aodv_SOURCES
model/aodv-id-cache.cc
model/aodv-dpd.cc
model/aodv-rtable.cc
model/aodv-rqueue.cc
model/aodv-packet.cc
model/aodv-neighbor.cc
model/aodv-routing-protocol.cc
helper/aodv-helper.cc)
set(ns3-aodv_INCLUDES
.
#
.)
include_directories(${ns3-aodv_INCLUDES})
add_library(ns3-aodv SHARED ${ns3-aodv_SOURCES})
target_link_libraries(ns3-aodv ns3-internet)
target_link_libraries(ns3-aodv ns3-wifi)
+35
View File
@@ -0,0 +1,35 @@
set(ns3-applications_SOURCES
model/bulk-send-application.cc
model/onoff-application.cc
model/packet-sink.cc
model/udp-client.cc
model/udp-server.cc
model/seq-ts-header.cc
model/udp-trace-client.cc
model/packet-loss-counter.cc
model/udp-echo-client.cc
model/udp-echo-server.cc
model/application-packet-probe.cc
model/three-gpp-http-client.cc
model/three-gpp-http-server.cc
model/three-gpp-http-header.cc
model/three-gpp-http-variables.cc
helper/bulk-send-helper.cc
helper/on-off-helper.cc
helper/packet-sink-helper.cc
helper/udp-client-server-helper.cc
helper/udp-echo-helper.cc
helper/three-gpp-http-helper.cc)
set(ns3-applications_INCLUDES
#)
include_directories(${ns3-applications_INCLUDES})
add_library(ns3-applications SHARED ${ns3-applications_SOURCES})
target_link_libraries(ns3-applications ns3-internet)
target_link_libraries(ns3-applications ns3-config-store)
target_link_libraries(ns3-applications ns3-stats)
+15
View File
@@ -0,0 +1,15 @@
set(ns3-bridge_SOURCES
model/bridge-net-device.cc
model/bridge-channel.cc
helper/bridge-helper.cc)
set(ns3-bridge_INCLUDES
#)
include_directories(${ns3-bridge_INCLUDES})
add_library(ns3-bridge SHARED ${ns3-bridge_SOURCES})
target_link_libraries(ns3-bridge ns3-network)
+25
View File
@@ -0,0 +1,25 @@
set(ns3-buildings_SOURCES
model/building.cc
model/building-list.cc
model/mobility-building-info.cc
model/itu-r-1238-propagation-loss-model.cc
model/buildings-propagation-loss-model.cc
model/hybrid-buildings-propagation-loss-model.cc
model/oh-buildings-propagation-loss-model.cc
helper/building-container.cc
helper/building-position-allocator.cc
helper/building-allocator.cc
helper/buildings-helper.cc)
set(ns3-buildings_INCLUDES
#)
include_directories(${ns3-buildings_INCLUDES})
add_library(ns3-buildings SHARED ${ns3-buildings_SOURCES})
target_link_libraries(ns3-buildings ns3-mobility)
target_link_libraries(ns3-buildings ns3-propagation)
target_link_libraries(ns3-buildings ns3-config-store)
+18
View File
@@ -0,0 +1,18 @@
set(ns3-config-store_SOURCES
model/attribute-iterator.cc
model/config-store.cc
model/attribute-default-iterator.cc
model/file-config.cc
model/raw-text-config.cc)
set(ns3-config-store_INCLUDES
#)
include_directories(${ns3-config-store_INCLUDES})
add_library(ns3-config-store SHARED ${ns3-config-store_SOURCES})
target_link_libraries(ns3-config-store ns3-core)
target_link_libraries(ns3-config-store ns3-network)
+78
View File
@@ -0,0 +1,78 @@
set(ns3-core_SOURCES
model/time.cc
model/event-id.cc
model/scheduler.cc
model/list-scheduler.cc
model/map-scheduler.cc
model/heap-scheduler.cc
model/calendar-scheduler.cc
model/event-impl.cc
model/simulator.cc
model/simulator-impl.cc
model/default-simulator-impl.cc
model/timer.cc
model/watchdog.cc
model/synchronizer.cc
model/make-event.cc
model/log.cc
model/breakpoint.cc
model/type-id.cc
model/attribute-construction-list.cc
model/object-base.cc
model/ref-count-base.cc
model/object.cc
model/test.cc
model/random-variable-stream.cc
model/rng-seed-manager.cc
model/rng-stream.cc
model/command-line.cc
model/type-name.cc
model/attribute.cc
model/boolean.cc
model/integer.cc
model/uinteger.cc
model/enum.cc
model/double.cc
model/int64x64.cc
model/string.cc
model/pointer.cc
model/object-ptr-container.cc
model/object-factory.cc
model/global-value.cc
model/trace-source-accessor.cc
model/config.cc
model/callback.cc
model/names.cc
model/vector.cc
model/fatal-impl.cc
model/system-path.cc
helper/random-variable-stream-helper.cc
helper/event-garbage-collector.cc
model/hash-function.cc
model/hash-murmur3.cc
model/hash-fnv.cc
model/hash.cc
model/des-metrics.cc
model/node-printer.cc
model/time-printer.cc
model/show-progress.cc
model/unix-system-wall-clock-ms.cc
model/int64x64-128.cc
model/realtime-simulator-impl.cc
model/wall-clock-synchronizer.cc
model/system-thread.cc
model/unix-fd-reader.cc
model/unix-system-mutex.cc
model/unix-system-condition.cc)
set(ns3-core_INCLUDES
#)
include_directories(${ns3-core_INCLUDES})
add_library(ns3-core SHARED ${ns3-core_SOURCES})
target_link_libraries(ns3-core RT)
target_link_libraries(ns3-core PTHREAD)
+15
View File
@@ -0,0 +1,15 @@
set(ns3-csma-layout_SOURCES
model/csma-star-helper.cc)
set(ns3-csma-layout_INCLUDES
#)
include_directories(${ns3-csma-layout_INCLUDES})
add_library(ns3-csma-layout SHARED ${ns3-csma-layout_SOURCES})
target_link_libraries(ns3-csma-layout ns3-csma)
target_link_libraries(ns3-csma-layout ns3-network)
target_link_libraries(ns3-csma-layout ns3-internet)
+16
View File
@@ -0,0 +1,16 @@
set(ns3-csma_SOURCES
model/backoff.cc
model/csma-net-device.cc
model/csma-channel.cc
helper/csma-helper.cc)
set(ns3-csma_INCLUDES
#)
include_directories(${ns3-csma_INCLUDES})
add_library(ns3-csma SHARED ${ns3-csma_SOURCES})
target_link_libraries(ns3-csma ns3-network)
+19
View File
@@ -0,0 +1,19 @@
set(ns3-dsdv_SOURCES
model/dsdv-rtable.cc
model/dsdv-packet-queue.cc
model/dsdv-packet.cc
model/dsdv-routing-protocol.cc
helper/dsdv-helper.cc)
set(ns3-dsdv_INCLUDES
.
#
.)
include_directories(${ns3-dsdv_INCLUDES})
add_library(ns3-dsdv SHARED ${ns3-dsdv_SOURCES})
target_link_libraries(ns3-dsdv ns3-internet)
+29
View File
@@ -0,0 +1,29 @@
set(ns3-dsr_SOURCES
model/dsr-routing.cc
model/dsr-options.cc
model/dsr-fs-header.cc
model/dsr-option-header.cc
model/dsr-maintain-buff.cc
model/dsr-passive-buff.cc
model/dsr-rsendbuff.cc
model/dsr-rcache.cc
model/dsr-rreq-table.cc
model/dsr-gratuitous-reply-table.cc
model/dsr-errorbuff.cc
model/dsr-network-queue.cc
helper/dsr-helper.cc
helper/dsr-main-helper.cc)
set(ns3-dsr_INCLUDES
.
#
.)
include_directories(${ns3-dsr_INCLUDES})
add_library(ns3-dsr SHARED ${ns3-dsr_SOURCES})
target_link_libraries(ns3-dsr ns3-internet)
target_link_libraries(ns3-dsr ns3-wifi)
+29
View File
@@ -0,0 +1,29 @@
set(ns3-energy_SOURCES
model/energy-source.cc
model/basic-energy-source.cc
model/li-ion-energy-source.cc
model/rv-battery-model.cc
model/device-energy-model.cc
model/device-energy-model-container.cc
model/simple-device-energy-model.cc
model/energy-harvester.cc
model/basic-energy-harvester.cc
helper/energy-source-container.cc
helper/energy-model-helper.cc
helper/basic-energy-source-helper.cc
helper/li-ion-energy-source-helper.cc
helper/rv-battery-model-helper.cc
helper/energy-harvester-container.cc
helper/energy-harvester-helper.cc
helper/basic-energy-harvester-helper.cc)
set(ns3-energy_INCLUDES
#)
include_directories(${ns3-energy_INCLUDES})
add_library(ns3-energy SHARED ${ns3-energy_SOURCES})
target_link_libraries(ns3-energy ns3-network)
+30
View File
@@ -0,0 +1,30 @@
set(ns3-fd-net-device_SOURCES
model/fd-net-device.cc
helper/fd-net-device-helper.cc
helper/encode-decode.cc
helper/creator-utils.cc
helper/tap-fd-net-device-helper.cc
helper/emu-fd-net-device-helper.cc)
set(ns3-fd-net-device_INCLUDES
#)
include_directories(${ns3-fd-net-device_INCLUDES})
add_library(ns3-fd-net-device SHARED ${ns3-fd-net-device_SOURCES})
target_link_libraries(ns3-fd-net-device ns3-network)
set(tap-device-creator_SOURCES
helper/tap-device-creator.cc
helper/encode-decode.cc
helper/creator-utils.cc)
add_executable(tap-device-creator ${tap-device-creator_SOURCES})
set(raw-sock-creator_SOURCES
helper/raw-sock-creator.cc
helper/encode-decode.cc
helper/creator-utils.cc)
add_executable(raw-sock-creator ${raw-sock-creator_SOURCES})
+22
View File
@@ -0,0 +1,22 @@
set(ns3-flow-monitor_SOURCES
model/flow-monitor.cc
model/flow-classifier.cc
model/flow-probe.cc
model/ipv4-flow-classifier.cc
model/ipv4-flow-probe.cc
model/ipv6-flow-classifier.cc
model/ipv6-flow-probe.cc
model/histogram.cc
helper/flow-monitor-helper.cc)
set(ns3-flow-monitor_INCLUDES
#)
include_directories(${ns3-flow-monitor_INCLUDES})
add_library(ns3-flow-monitor SHARED ${ns3-flow-monitor_SOURCES})
target_link_libraries(ns3-flow-monitor ns3-internet)
target_link_libraries(ns3-flow-monitor ns3-config-store)
+24
View File
@@ -0,0 +1,24 @@
set(ns3-internet-apps_SOURCES
model/ping6.cc
model/radvd-interface.cc
model/radvd-prefix.cc
model/radvd.cc
model/v4ping.cc
model/dhcp-header.cc
model/dhcp-server.cc
model/dhcp-client.cc
helper/ping6-helper.cc
helper/radvd-helper.cc
helper/v4ping-helper.cc
helper/dhcp-helper.cc)
set(ns3-internet-apps_INCLUDES
#)
include_directories(${ns3-internet-apps_INCLUDES})
add_library(ns3-internet-apps SHARED ${ns3-internet-apps_SOURCES})
target_link_libraries(ns3-internet-apps ns3-internet)
+137
View File
@@ -0,0 +1,137 @@
set(ns3-internet_SOURCES
model/ip-l4-protocol.cc
model/udp-header.cc
model/tcp-header.cc
model/ipv4-interface.cc
model/ipv4-l3-protocol.cc
model/ipv4-end-point.cc
model/udp-l4-protocol.cc
model/tcp-l4-protocol.cc
model/arp-header.cc
model/arp-cache.cc
model/arp-l3-protocol.cc
model/arp-queue-disc-item.cc
model/udp-socket-impl.cc
model/ipv4-end-point-demux.cc
model/udp-socket-factory-impl.cc
model/tcp-socket-factory-impl.cc
model/pending-data.cc
model/rtt-estimator.cc
model/ipv4-raw-socket-factory-impl.cc
model/ipv4-raw-socket-impl.cc
model/icmpv4.cc
model/icmpv4-l4-protocol.cc
model/loopback-net-device.cc
model/ndisc-cache.cc
model/ipv6-interface.cc
model/icmpv6-header.cc
model/ipv6-l3-protocol.cc
model/ipv6-end-point.cc
model/ipv6-end-point-demux.cc
model/ipv6-raw-socket-factory-impl.cc
model/ipv6-raw-socket-impl.cc
model/ipv6-autoconfigured-prefix.cc
model/ipv6-extension.cc
model/ipv6-extension-header.cc
model/ipv6-extension-demux.cc
model/ipv6-option.cc
model/ipv6-option-header.cc
model/ipv6-option-demux.cc
model/icmpv6-l4-protocol.cc
model/tcp-socket-base.cc
model/tcp-socket-state.cc
model/tcp-highspeed.cc
model/tcp-hybla.cc
model/tcp-vegas.cc
model/tcp-congestion-ops.cc
model/tcp-westwood.cc
model/tcp-scalable.cc
model/tcp-veno.cc
model/tcp-bic.cc
model/tcp-yeah.cc
model/tcp-ledbat.cc
model/tcp-illinois.cc
model/tcp-htcp.cc
model/tcp-lp.cc
model/tcp-rx-buffer.cc
model/tcp-tx-buffer.cc
model/tcp-option.cc
model/tcp-option-rfc793.cc
model/tcp-option-winscale.cc
model/tcp-option-ts.cc
model/tcp-option-sack-permitted.cc
model/tcp-option-sack.cc
model/ipv4-packet-info-tag.cc
model/ipv6-packet-info-tag.cc
model/ipv4-interface-address.cc
model/ipv4-address-generator.cc
model/ipv4-header.cc
model/ipv4-queue-disc-item.cc
model/ipv4-packet-filter.cc
model/ipv4-route.cc
model/ipv4-routing-protocol.cc
model/udp-socket.cc
model/udp-socket-factory.cc
model/tcp-socket.cc
model/tcp-socket-factory.cc
model/tcp-recovery-ops.cc
model/tcp-prr-recovery.cc
model/ipv4.cc
model/ipv4-raw-socket-factory.cc
model/ipv6-header.cc
model/ipv6-queue-disc-item.cc
model/ipv6-packet-filter.cc
model/ipv6-interface-address.cc
model/ipv6-route.cc
model/ipv6.cc
model/ipv6-raw-socket-factory.cc
model/ipv6-routing-protocol.cc
model/ipv4-list-routing.cc
model/ipv6-list-routing.cc
helper/ipv4-list-routing-helper.cc
helper/ipv6-list-routing-helper.cc
model/ipv4-static-routing.cc
model/ipv4-routing-table-entry.cc
model/ipv6-static-routing.cc
model/ipv6-routing-table-entry.cc
helper/ipv4-static-routing-helper.cc
helper/ipv6-static-routing-helper.cc
model/global-router-interface.cc
model/global-route-manager.cc
model/global-route-manager-impl.cc
model/candidate-queue.cc
model/ipv4-global-routing.cc
helper/ipv4-global-routing-helper.cc
helper/internet-stack-helper.cc
helper/internet-trace-helper.cc
helper/ipv4-address-helper.cc
helper/ipv4-interface-container.cc
helper/ipv4-routing-helper.cc
helper/ipv6-address-helper.cc
helper/ipv6-interface-container.cc
helper/ipv6-routing-helper.cc
model/ipv6-address-generator.cc
model/ipv4-packet-probe.cc
model/ipv6-packet-probe.cc
model/ipv6-pmtu-cache.cc
model/ripng.cc
model/ripng-header.cc
helper/ripng-helper.cc
model/rip.cc
model/rip-header.cc
helper/rip-helper.cc)
set(ns3-internet_INCLUDES
#)
include_directories(${ns3-internet_INCLUDES})
add_library(ns3-internet SHARED ${ns3-internet_SOURCES})
target_link_libraries(ns3-internet ns3-bridge)
target_link_libraries(ns3-internet ns3-mpi)
target_link_libraries(ns3-internet ns3-traffic-control)
target_link_libraries(ns3-internet ns3-network)
target_link_libraries(ns3-internet ns3-core)
+28
View File
@@ -0,0 +1,28 @@
set(ns3-lr-wpan_SOURCES
model/lr-wpan-error-model.cc
model/lr-wpan-interference-helper.cc
model/lr-wpan-phy.cc
model/lr-wpan-mac.cc
model/lr-wpan-mac-header.cc
model/lr-wpan-mac-trailer.cc
model/lr-wpan-csmaca.cc
model/lr-wpan-net-device.cc
model/lr-wpan-spectrum-value-helper.cc
model/lr-wpan-spectrum-signal-parameters.cc
model/lr-wpan-lqi-tag.cc
helper/lr-wpan-helper.cc)
set(ns3-lr-wpan_INCLUDES
#)
include_directories(${ns3-lr-wpan_INCLUDES})
add_library(ns3-lr-wpan SHARED ${ns3-lr-wpan_SOURCES})
target_link_libraries(ns3-lr-wpan ns3-core)
target_link_libraries(ns3-lr-wpan ns3-network)
target_link_libraries(ns3-lr-wpan ns3-mobility)
target_link_libraries(ns3-lr-wpan ns3-spectrum)
target_link_libraries(ns3-lr-wpan ns3-propagation)
+150
View File
@@ -0,0 +1,150 @@
set(ns3-lte_SOURCES
model/lte-common.cc
model/lte-spectrum-phy.cc
model/lte-spectrum-signal-parameters.cc
model/lte-phy.cc
model/lte-enb-phy.cc
model/lte-ue-phy.cc
model/lte-spectrum-value-helper.cc
model/lte-amc.cc
model/lte-enb-rrc.cc
model/lte-ue-rrc.cc
model/lte-rrc-sap.cc
model/lte-rrc-protocol-ideal.cc
model/lte-rrc-protocol-real.cc
model/lte-rlc-sap.cc
model/lte-rlc.cc
model/lte-rlc-sequence-number.cc
model/lte-rlc-header.cc
model/lte-rlc-am-header.cc
model/lte-rlc-tm.cc
model/lte-rlc-um.cc
model/lte-rlc-am.cc
model/lte-rlc-tag.cc
model/lte-rlc-sdu-status-tag.cc
model/lte-pdcp-sap.cc
model/lte-pdcp.cc
model/lte-pdcp-header.cc
model/lte-pdcp-tag.cc
model/eps-bearer.cc
model/lte-radio-bearer-info.cc
model/lte-net-device.cc
model/lte-enb-net-device.cc
model/lte-ue-net-device.cc
model/lte-control-messages.cc
helper/lte-helper.cc
helper/lte-stats-calculator.cc
helper/epc-helper.cc
helper/no-backhaul-epc-helper.cc
helper/point-to-point-epc-helper.cc
helper/radio-bearer-stats-calculator.cc
helper/radio-bearer-stats-connector.cc
helper/phy-stats-calculator.cc
helper/mac-stats-calculator.cc
helper/phy-tx-stats-calculator.cc
helper/phy-rx-stats-calculator.cc
helper/radio-environment-map-helper.cc
helper/lte-hex-grid-enb-topology-helper.cc
helper/lte-global-pathloss-database.cc
model/rem-spectrum-phy.cc
model/ff-mac-common.cc
model/ff-mac-csched-sap.cc
model/ff-mac-sched-sap.cc
model/lte-mac-sap.cc
model/ff-mac-scheduler.cc
model/lte-enb-cmac-sap.cc
model/lte-ue-cmac-sap.cc
model/rr-ff-mac-scheduler.cc
model/lte-enb-mac.cc
model/lte-ue-mac.cc
model/lte-radio-bearer-tag.cc
model/eps-bearer-tag.cc
model/lte-phy-tag.cc
model/lte-enb-phy-sap.cc
model/lte-enb-cphy-sap.cc
model/lte-ue-phy-sap.cc
model/lte-ue-cphy-sap.cc
model/lte-interference.cc
model/lte-chunk-processor.cc
model/pf-ff-mac-scheduler.cc
model/fdmt-ff-mac-scheduler.cc
model/tdmt-ff-mac-scheduler.cc
model/tta-ff-mac-scheduler.cc
model/fdbet-ff-mac-scheduler.cc
model/tdbet-ff-mac-scheduler.cc
model/fdtbfq-ff-mac-scheduler.cc
model/tdtbfq-ff-mac-scheduler.cc
model/pss-ff-mac-scheduler.cc
model/cqa-ff-mac-scheduler.cc
model/epc-gtpu-header.cc
model/epc-gtpc-header.cc
model/epc-enb-application.cc
model/epc-sgw-application.cc
model/epc-pgw-application.cc
model/epc-mme-application.cc
model/epc-x2-sap.cc
model/epc-x2-header.cc
model/epc-x2.cc
model/epc-tft.cc
model/epc-tft-classifier.cc
model/lte-mi-error-model.cc
model/lte-vendor-specific-parameters.cc
model/epc-enb-s1-sap.cc
model/epc-s1ap-sap.cc
model/epc-s11-sap.cc
model/lte-as-sap.cc
model/epc-ue-nas.cc
model/lte-harq-phy.cc
model/lte-asn1-header.cc
model/lte-rrc-header.cc
model/lte-handover-management-sap.cc
model/lte-handover-algorithm.cc
model/a2-a4-rsrq-handover-algorithm.cc
model/a3-rsrp-handover-algorithm.cc
model/no-op-handover-algorithm.cc
model/lte-anr-sap.cc
model/lte-anr.cc
model/lte-ffr-algorithm.cc
model/lte-ffr-sap.cc
model/lte-ffr-rrc-sap.cc
model/lte-fr-no-op-algorithm.cc
model/lte-fr-hard-algorithm.cc
model/lte-fr-strict-algorithm.cc
model/lte-fr-soft-algorithm.cc
model/lte-ffr-soft-algorithm.cc
model/lte-ffr-enhanced-algorithm.cc
model/lte-ffr-distributed-algorithm.cc
model/lte-ue-power-control.cc
model/lte-ccm-rrc-sap.cc
model/lte-ue-ccm-rrc-sap.cc
model/lte-ccm-mac-sap.cc
model/lte-enb-component-carrier-manager.cc
model/lte-ue-component-carrier-manager.cc
model/no-op-component-carrier-manager.cc
model/simple-ue-component-carrier-manager.cc
model/component-carrier.cc
helper/cc-helper.cc
model/component-carrier-ue.cc
model/component-carrier-enb.cc
helper/emu-epc-helper.cc)
set(ns3-lte_INCLUDES
#)
include_directories(${ns3-lte_INCLUDES})
add_library(ns3-lte SHARED ${ns3-lte_SOURCES})
target_link_libraries(ns3-lte ns3-core)
target_link_libraries(ns3-lte ns3-network)
target_link_libraries(ns3-lte ns3-spectrum)
target_link_libraries(ns3-lte ns3-stats)
target_link_libraries(ns3-lte ns3-buildings)
target_link_libraries(ns3-lte ns3-virtual-net-device)
target_link_libraries(ns3-lte ns3-point-to-point)
target_link_libraries(ns3-lte ns3-applications)
target_link_libraries(ns3-lte ns3-internet)
target_link_libraries(ns3-lte ns3-csma)
target_link_libraries(ns3-lte ns3-fd-net-device)
+46
View File
@@ -0,0 +1,46 @@
set(ns3-mesh_SOURCES
model/mesh-information-element-vector.cc
model/mesh-point-device.cc
model/mesh-l2-routing-protocol.cc
model/mesh-wifi-beacon.cc
model/mesh-wifi-interface-mac.cc
model/dot11s/ie-dot11s-beacon-timing.cc
model/dot11s/ie-dot11s-configuration.cc
model/dot11s/ie-dot11s-id.cc
model/dot11s/ie-dot11s-peer-management.cc
model/dot11s/ie-dot11s-preq.cc
model/dot11s/ie-dot11s-prep.cc
model/dot11s/ie-dot11s-perr.cc
model/dot11s/ie-dot11s-rann.cc
model/dot11s/ie-dot11s-peering-protocol.cc
model/dot11s/ie-dot11s-metric-report.cc
model/dot11s/dot11s-mac-header.cc
model/dot11s/peer-link-frame.cc
model/dot11s/peer-link.cc
model/dot11s/peer-management-protocol-mac.cc
model/dot11s/peer-management-protocol.cc
model/dot11s/hwmp-tag.cc
model/dot11s/hwmp-rtable.cc
model/dot11s/hwmp-protocol-mac.cc
model/dot11s/hwmp-protocol.cc
model/dot11s/airtime-metric.cc
model/flame/flame-header.cc
model/flame/flame-rtable.cc
model/flame/flame-protocol-mac.cc
model/flame/flame-protocol.cc
helper/mesh-helper.cc
helper/mesh-stack-installer.cc
helper/dot11s/dot11s-installer.cc
helper/flame/flame-installer.cc)
set(ns3-mesh_INCLUDES
#)
include_directories(${ns3-mesh_INCLUDES})
add_library(ns3-mesh SHARED ${ns3-mesh_SOURCES})
target_link_libraries(ns3-mesh ns3-internet)
target_link_libraries(ns3-mesh ns3-wifi)
+31
View File
@@ -0,0 +1,31 @@
set(ns3-mobility_SOURCES
model/box.cc
model/constant-acceleration-mobility-model.cc
model/constant-position-mobility-model.cc
model/constant-velocity-helper.cc
model/constant-velocity-mobility-model.cc
model/gauss-markov-mobility-model.cc
model/geographic-positions.cc
model/hierarchical-mobility-model.cc
model/mobility-model.cc
model/position-allocator.cc
model/random-direction-2d-mobility-model.cc
model/random-walk-2d-mobility-model.cc
model/random-waypoint-mobility-model.cc
model/rectangle.cc
model/steady-state-random-waypoint-mobility-model.cc
model/waypoint.cc
model/waypoint-mobility-model.cc
helper/mobility-helper.cc
helper/ns2-mobility-helper.cc)
set(ns3-mobility_INCLUDES
#)
include_directories(${ns3-mobility_INCLUDES})
add_library(ns3-mobility SHARED ${ns3-mobility_SOURCES})
target_link_libraries(ns3-mobility ns3-network)
+21
View File
@@ -0,0 +1,21 @@
set(ns3-mpi_SOURCES
model/distributed-simulator-impl.cc
model/granted-time-window-mpi-interface.cc
model/mpi-receiver.cc
model/null-message-simulator-impl.cc
model/null-message-mpi-interface.cc
model/remote-channel-bundle.cc
model/remote-channel-bundle-manager.cc
model/mpi-interface.cc)
set(ns3-mpi_INCLUDES
#)
include_directories(${ns3-mpi_INCLUDES})
add_library(ns3-mpi SHARED ${ns3-mpi_SOURCES})
target_link_libraries(ns3-mpi ns3-core)
target_link_libraries(ns3-mpi ns3-network)
+341
View File
@@ -0,0 +1,341 @@
set(version-NFD-objects_SOURCES
../../build/src/ndnSIM/NFD/core/version.cpp)
set(version-NFD-objects_INCLUDES
../../ns3/ndnSIM/NFD
../../ns3/ndnSIM/NFD)
include_directories(${version-NFD-objects_INCLUDES})
add_library(version-NFD-objects ${version-NFD-objects_SOURCES})
target_link_libraries(version-NFD-objects version-NFD)
target_link_libraries(version-NFD-objects versioncpp-NFD)
set(ns3-ndnSIM_SOURCES
apps/ndn-app.cpp
apps/ndn-consumer-batches.cpp
apps/ndn-consumer-cbr.cpp
apps/ndn-consumer-nwfq.cpp
apps/ndn-consumer-pcon.cpp
apps/ndn-consumer-window.cpp
apps/ndn-consumer-zipf-mandelbrot.cpp
apps/ndn-consumer.cpp
apps/ndn-producer.cpp
bindings/module-helpers.cpp
helper/lfid/abstract-fib.cpp
helper/lfid/fib-nexthop.cpp
helper/lfid/ndn-global-routing-helper-lfid.cpp
helper/lfid/remove-loops.cpp
helper/ndn-app-helper.cpp
helper/ndn-fib-helper.cpp
helper/ndn-global-routing-helper.cpp
helper/ndn-link-control-helper.cpp
helper/ndn-network-region-table-helper.cpp
helper/ndn-scenario-helper.cpp
helper/ndn-stack-helper.cpp
helper/ndn-strategy-choice-helper.cpp
model/ndn-app-link-service.cpp
model/ndn-block-header.cpp
model/ndn-common.cpp
model/ndn-global-router.cpp
model/ndn-l3-protocol.cpp
model/ndn-net-device-transport.cpp
utils/batches.cpp
utils/dummy-keychain.cpp
utils/ndn-rtt-estimator.cpp
utils/ndn-rtt-mean-deviation.cpp
utils/ndn-time.cpp
utils/topology/annotated-topology-reader.cpp
utils/topology/rocketfuel-map-reader.cpp
utils/topology/rocketfuel-weights-reader.cpp
utils/tracers/l2-rate-tracer.cpp
utils/tracers/l2-tracer.cpp
utils/tracers/ndn-app-delay-tracer.cpp
utils/tracers/ndn-cs-tracer.cpp
utils/tracers/ndn-l3-rate-tracer.cpp
utils/tracers/ndn-l3-tracer.cpp
ndn-cxx/ndn-cxx/data.cpp
ndn-cxx/ndn-cxx/delegation-list.cpp
ndn-cxx/ndn-cxx/detail/cancel-handle.cpp
ndn-cxx/ndn-cxx/detail/packet-base.cpp
ndn-cxx/ndn-cxx/encoding/block-helpers.cpp
ndn-cxx/ndn-cxx/encoding/block.cpp
ndn-cxx/ndn-cxx/encoding/buffer-stream.cpp
ndn-cxx/ndn-cxx/encoding/encoder.cpp
ndn-cxx/ndn-cxx/encoding/estimator.cpp
ndn-cxx/ndn-cxx/encoding/nfd-constants.cpp
ndn-cxx/ndn-cxx/encoding/tlv.cpp
ndn-cxx/ndn-cxx/face.cpp
ndn-cxx/ndn-cxx/ims/in-memory-storage-entry.cpp
ndn-cxx/ndn-cxx/ims/in-memory-storage-fifo.cpp
ndn-cxx/ndn-cxx/ims/in-memory-storage-lfu.cpp
ndn-cxx/ndn-cxx/ims/in-memory-storage-lru.cpp
ndn-cxx/ndn-cxx/ims/in-memory-storage-persistent.cpp
ndn-cxx/ndn-cxx/ims/in-memory-storage.cpp
ndn-cxx/ndn-cxx/interest-filter.cpp
ndn-cxx/ndn-cxx/interest.cpp
ndn-cxx/ndn-cxx/key-locator.cpp
ndn-cxx/ndn-cxx/link.cpp
ndn-cxx/ndn-cxx/lp/cache-policy.cpp
ndn-cxx/ndn-cxx/lp/geo-tag.cpp
ndn-cxx/ndn-cxx/lp/nack-header.cpp
ndn-cxx/ndn-cxx/lp/nack.cpp
ndn-cxx/ndn-cxx/lp/packet.cpp
ndn-cxx/ndn-cxx/lp/pit-token.cpp
ndn-cxx/ndn-cxx/lp/prefix-announcement-header.cpp
ndn-cxx/ndn-cxx/meta-info.cpp
ndn-cxx/ndn-cxx/metadata-object.cpp
ndn-cxx/ndn-cxx/mgmt/control-response.cpp
ndn-cxx/ndn-cxx/mgmt/dispatcher.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/channel-status.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/command-options.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/control-command.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/control-parameters.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/controller.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/cs-info.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/face-event-notification.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/face-monitor.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/face-query-filter.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/face-status.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/fib-entry.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/forwarder-status.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/rib-entry.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/status-dataset.cpp
ndn-cxx/ndn-cxx/mgmt/nfd/strategy-choice.cpp
ndn-cxx/ndn-cxx/mgmt/status-dataset-context.cpp
ndn-cxx/ndn-cxx/name-component.cpp
ndn-cxx/ndn-cxx/name.cpp
ndn-cxx/ndn-cxx/net/ethernet.cpp
ndn-cxx/ndn-cxx/net/face-uri.cpp
ndn-cxx/ndn-cxx/net/network-address.cpp
ndn-cxx/ndn-cxx/prefix-announcement.cpp
ndn-cxx/ndn-cxx/security/command-interest-signer.cpp
ndn-cxx/ndn-cxx/security/digest-sha256.cpp
ndn-cxx/ndn-cxx/security/impl/openssl-helper.cpp
ndn-cxx/ndn-cxx/security/key-params.cpp
ndn-cxx/ndn-cxx/security/pib/certificate-container.cpp
ndn-cxx/ndn-cxx/security/pib/identity-container.cpp
ndn-cxx/ndn-cxx/security/pib/identity.cpp
ndn-cxx/ndn-cxx/security/pib/impl/identity-impl.cpp
ndn-cxx/ndn-cxx/security/pib/impl/key-impl.cpp
ndn-cxx/ndn-cxx/security/pib/impl/pib-memory.cpp
ndn-cxx/ndn-cxx/security/pib/impl/pib-sqlite3.cpp
ndn-cxx/ndn-cxx/security/pib/key-container.cpp
ndn-cxx/ndn-cxx/security/pib/key.cpp
ndn-cxx/ndn-cxx/security/pib/pib.cpp
ndn-cxx/ndn-cxx/security/safe-bag.cpp
ndn-cxx/ndn-cxx/security/security-common.cpp
ndn-cxx/ndn-cxx/security/signature-sha256-with-ecdsa.cpp
ndn-cxx/ndn-cxx/security/signature-sha256-with-rsa.cpp
ndn-cxx/ndn-cxx/security/signing-helpers.cpp
ndn-cxx/ndn-cxx/security/signing-info.cpp
ndn-cxx/ndn-cxx/security/tpm/back-end.cpp
ndn-cxx/ndn-cxx/security/tpm/impl/back-end-file.cpp
ndn-cxx/ndn-cxx/security/tpm/impl/back-end-mem.cpp
ndn-cxx/ndn-cxx/security/tpm/impl/key-handle-mem.cpp
ndn-cxx/ndn-cxx/security/tpm/key-handle.cpp
ndn-cxx/ndn-cxx/security/tpm/tpm.cpp
ndn-cxx/ndn-cxx/security/transform/base64-decode.cpp
ndn-cxx/ndn-cxx/security/transform/base64-encode.cpp
ndn-cxx/ndn-cxx/security/transform/block-cipher.cpp
ndn-cxx/ndn-cxx/security/transform/bool-sink.cpp
ndn-cxx/ndn-cxx/security/transform/buffer-source.cpp
ndn-cxx/ndn-cxx/security/transform/digest-filter.cpp
ndn-cxx/ndn-cxx/security/transform/hex-decode.cpp
ndn-cxx/ndn-cxx/security/transform/hex-encode.cpp
ndn-cxx/ndn-cxx/security/transform/private-key.cpp
ndn-cxx/ndn-cxx/security/transform/public-key.cpp
ndn-cxx/ndn-cxx/security/transform/signer-filter.cpp
ndn-cxx/ndn-cxx/security/transform/step-source.cpp
ndn-cxx/ndn-cxx/security/transform/stream-sink.cpp
ndn-cxx/ndn-cxx/security/transform/stream-source.cpp
ndn-cxx/ndn-cxx/security/transform/strip-space.cpp
ndn-cxx/ndn-cxx/security/transform/transform-base.cpp
ndn-cxx/ndn-cxx/security/transform/verifier-filter.cpp
ndn-cxx/ndn-cxx/security/v2/additional-description.cpp
ndn-cxx/ndn-cxx/security/v2/certificate-bundle-fetcher.cpp
ndn-cxx/ndn-cxx/security/v2/certificate-cache.cpp
ndn-cxx/ndn-cxx/security/v2/certificate-fetcher-direct-fetch.cpp
ndn-cxx/ndn-cxx/security/v2/certificate-fetcher-from-network.cpp
ndn-cxx/ndn-cxx/security/v2/certificate-fetcher-offline.cpp
ndn-cxx/ndn-cxx/security/v2/certificate-fetcher.cpp
ndn-cxx/ndn-cxx/security/v2/certificate-storage.cpp
ndn-cxx/ndn-cxx/security/v2/certificate.cpp
ndn-cxx/ndn-cxx/security/v2/key-chain.cpp
ndn-cxx/ndn-cxx/security/v2/trust-anchor-container.cpp
ndn-cxx/ndn-cxx/security/v2/trust-anchor-group.cpp
ndn-cxx/ndn-cxx/security/v2/validation-error.cpp
ndn-cxx/ndn-cxx/security/v2/validation-policy-command-interest.cpp
ndn-cxx/ndn-cxx/security/v2/validation-policy-config.cpp
ndn-cxx/ndn-cxx/security/v2/validation-policy-simple-hierarchy.cpp
ndn-cxx/ndn-cxx/security/v2/validation-policy.cpp
ndn-cxx/ndn-cxx/security/v2/validation-state.cpp
ndn-cxx/ndn-cxx/security/v2/validator-config/checker.cpp
ndn-cxx/ndn-cxx/security/v2/validator-config/filter.cpp
ndn-cxx/ndn-cxx/security/v2/validator-config/name-relation.cpp
ndn-cxx/ndn-cxx/security/v2/validator-config/rule.cpp
ndn-cxx/ndn-cxx/security/v2/validator.cpp
ndn-cxx/ndn-cxx/security/validator-config.cpp
ndn-cxx/ndn-cxx/security/validator-null.cpp
ndn-cxx/ndn-cxx/security/validity-period.cpp
ndn-cxx/ndn-cxx/security/verification-helpers.cpp
ndn-cxx/ndn-cxx/signature-info.cpp
ndn-cxx/ndn-cxx/signature.cpp
ndn-cxx/ndn-cxx/transport/transport.cpp
ndn-cxx/ndn-cxx/util/config-file.cpp
ndn-cxx/ndn-cxx/util/exception.cpp
ndn-cxx/ndn-cxx/util/indented-stream.cpp
ndn-cxx/ndn-cxx/util/io.cpp
ndn-cxx/ndn-cxx/util/logger.cpp
ndn-cxx/ndn-cxx/util/notification-subscriber.cpp
ndn-cxx/ndn-cxx/util/random.cpp
ndn-cxx/ndn-cxx/util/regex/regex-backref-manager.cpp
ndn-cxx/ndn-cxx/util/regex/regex-backref-matcher.cpp
ndn-cxx/ndn-cxx/util/regex/regex-component-matcher.cpp
ndn-cxx/ndn-cxx/util/regex/regex-component-set-matcher.cpp
ndn-cxx/ndn-cxx/util/regex/regex-matcher.cpp
ndn-cxx/ndn-cxx/util/regex/regex-pattern-list-matcher.cpp
ndn-cxx/ndn-cxx/util/regex/regex-pseudo-matcher.cpp
ndn-cxx/ndn-cxx/util/regex/regex-repeat-matcher.cpp
ndn-cxx/ndn-cxx/util/regex/regex-top-matcher.cpp
ndn-cxx/ndn-cxx/util/rtt-estimator.cpp
ndn-cxx/ndn-cxx/util/scheduler.cpp
ndn-cxx/ndn-cxx/util/segment-fetcher.cpp
ndn-cxx/ndn-cxx/util/sha256.cpp
ndn-cxx/ndn-cxx/util/signal/connection.cpp
ndn-cxx/ndn-cxx/util/signal/scoped-connection.cpp
ndn-cxx/ndn-cxx/util/sqlite3-statement.cpp
ndn-cxx/ndn-cxx/util/string-helper.cpp
ndn-cxx/ndn-cxx/util/time-unit-test-clock.cpp
ndn-cxx/ndn-cxx/util/time.cpp
NFD/core/network.cpp
NFD/daemon/common/city-hash.cpp
NFD/daemon/common/config-file.cpp
NFD/daemon/common/global.cpp
NFD/daemon/common/privilege-helper.cpp
NFD/daemon/face/channel.cpp
NFD/daemon/face/face-counters.cpp
NFD/daemon/face/face-system.cpp
NFD/daemon/face/face.cpp
NFD/daemon/face/generic-link-service.cpp
NFD/daemon/face/internal-face.cpp
NFD/daemon/face/internal-transport.cpp
NFD/daemon/face/link-service.cpp
NFD/daemon/face/lp-fragmenter.cpp
NFD/daemon/face/lp-reassembler.cpp
NFD/daemon/face/lp-reliability.cpp
NFD/daemon/face/netdev-bound.cpp
NFD/daemon/face/network-predicate.cpp
NFD/daemon/face/null-face.cpp
NFD/daemon/face/null-transport.cpp
NFD/daemon/face/nwfq.cpp
NFD/daemon/face/protocol-factory.cpp
NFD/daemon/face/socket-utils.cpp
NFD/daemon/face/transport.cpp
NFD/daemon/fw/access-strategy.cpp
NFD/daemon/fw/algorithm.cpp
NFD/daemon/fw/asf-measurements.cpp
NFD/daemon/fw/asf-probing-module.cpp
NFD/daemon/fw/asf-strategy.cpp
NFD/daemon/fw/best-route-strategy.cpp
NFD/daemon/fw/best-route-strategy2.cpp
NFD/daemon/fw/face-table.cpp
NFD/daemon/fw/forwarder.cpp
NFD/daemon/fw/multicast-strategy.cpp
NFD/daemon/fw/ncc-strategy.cpp
NFD/daemon/fw/process-nack-traits.cpp
NFD/daemon/fw/random-strategy.cpp
NFD/daemon/fw/retx-suppression-exponential.cpp
NFD/daemon/fw/retx-suppression-fixed.cpp
NFD/daemon/fw/scope-prefix.cpp
NFD/daemon/fw/self-learning-strategy.cpp
NFD/daemon/fw/strategy.cpp
NFD/daemon/fw/unsolicited-data-policy.cpp
NFD/daemon/mgmt/command-authenticator.cpp
NFD/daemon/mgmt/cs-manager.cpp
NFD/daemon/mgmt/face-manager.cpp
NFD/daemon/mgmt/fib-manager.cpp
NFD/daemon/mgmt/forwarder-status-manager.cpp
NFD/daemon/mgmt/general-config-section.cpp
NFD/daemon/mgmt/log-config-section.cpp
NFD/daemon/mgmt/manager-base.cpp
NFD/daemon/mgmt/rib-manager.cpp
NFD/daemon/mgmt/strategy-choice-manager.cpp
NFD/daemon/mgmt/tables-config-section.cpp
NFD/daemon/rib/fib-update.cpp
NFD/daemon/rib/fib-updater.cpp
NFD/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
NFD/daemon/rib/readvertise/host-to-gateway-readvertise-policy.cpp
NFD/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
NFD/daemon/rib/readvertise/readvertise-destination.cpp
NFD/daemon/rib/readvertise/readvertise.cpp
NFD/daemon/rib/rib-entry.cpp
NFD/daemon/rib/rib-update-batch.cpp
NFD/daemon/rib/rib-update.cpp
NFD/daemon/rib/rib.cpp
NFD/daemon/rib/route.cpp
NFD/daemon/rib/service.cpp
NFD/daemon/table/cleanup.cpp
NFD/daemon/table/cs-entry.cpp
NFD/daemon/table/cs-policy-lru.cpp
NFD/daemon/table/cs-policy-priority-fifo.cpp
NFD/daemon/table/cs-policy.cpp
NFD/daemon/table/cs.cpp
NFD/daemon/table/dead-nonce-list.cpp
NFD/daemon/table/fib-entry.cpp
NFD/daemon/table/fib.cpp
NFD/daemon/table/measurements-accessor.cpp
NFD/daemon/table/measurements.cpp
NFD/daemon/table/name-tree-entry.cpp
NFD/daemon/table/name-tree-hashtable.cpp
NFD/daemon/table/name-tree-iterator.cpp
NFD/daemon/table/name-tree.cpp
NFD/daemon/table/network-region-table.cpp
NFD/daemon/table/pit-entry.cpp
NFD/daemon/table/pit-face-record.cpp
NFD/daemon/table/pit-in-record.cpp
NFD/daemon/table/pit-iterator.cpp
NFD/daemon/table/pit-out-record.cpp
NFD/daemon/table/pit.cpp
NFD/daemon/table/strategy-choice-entry.cpp
NFD/daemon/table/strategy-choice.cpp)
set(ns3-ndnSIM_INCLUDES
../..
../../ns3/ndnSIM/NFD
./NFD/core
./NFD/daemon
./NFD/rib
../../ns3/ndnSIM
../../ns3/ndnSIM/ndn-cxx
#
../..
../../ns3/ndnSIM/NFD
./NFD/core
./NFD/daemon
./NFD/rib
../../ns3/ndnSIM
../../ns3/ndnSIM/ndn-cxx
/usr/include
/usr/include)
include_directories(${ns3-ndnSIM_INCLUDES})
add_library(ns3-ndnSIM SHARED ${ns3-ndnSIM_SOURCES})
target_link_libraries(ns3-ndnSIM ns3-core)
target_link_libraries(ns3-ndnSIM ns3-network)
target_link_libraries(ns3-ndnSIM ns3-point-to-point)
target_link_libraries(ns3-ndnSIM ns3-topology-read)
target_link_libraries(ns3-ndnSIM ns3-mobility)
target_link_libraries(ns3-ndnSIM ns3-internet)
target_link_libraries(ns3-ndnSIM version-ndn-cxx)
target_link_libraries(ns3-ndnSIM version-NFD-objects)
target_link_libraries(ns3-ndnSIM BOOST)
target_link_libraries(ns3-ndnSIM SQLITE3)
target_link_libraries(ns3-ndnSIM RT)
target_link_libraries(ns3-ndnSIM PTHREAD)
target_link_libraries(ns3-ndnSIM OPENSSL)
@@ -27,6 +27,7 @@
#include <ndn-cxx/lp/pit-token.hpp>
#include <ndn-cxx/lp/tags.hpp>
#include "common/global.hpp"
#include <cmath>
@@ -51,6 +52,30 @@ GenericLinkService::GenericLinkService(const GenericLinkService::Options& option
m_reassembler.beforeTimeout.connect([this] (auto...) { ++this->nReassemblyTimeouts; });
m_reliability.onDroppedInterest.connect([this] (const auto& i) { this->notifyDroppedInterest(i); });
nReassembling.observe(&m_reassembler);
this->nwfq.setC(options.C);
// 启动令牌生成流程
this->nwfq.startTokenBucket();
this->sendPacketCallback = [this](){
auto vq = this->nwfq.wfqSchedule();
while (vq != nullptr) {
auto task = vq->front();
ssize_t sendQueueLength = getTransport()->getSendQueueLength();
ssize_t sendQueueCapacity = getTransport()->getSendQueueCapacity();
if (sendQueueLength + 1024 > sendQueueCapacity) {
break;
}
vq->pop();
lp::Packet lpPacket(task.interestPtr->wireEncode());
encodeLpFields(*task.interestPtr, lpPacket);
this->sendNetPacket(std::move(lpPacket), task.endpointId, true);
vq = this->nwfq.wfqSchedule();
}
getScheduler().schedule(time::nanoseconds(1000 * 1000), this->sendPacketCallback);
};
getScheduler().schedule(time::nanoseconds(1000 * 1000), this->sendPacketCallback);
}
void
@@ -95,11 +120,28 @@ GenericLinkService::sendLpPacket(lp::Packet&& pkt, const EndpointId& endpointId)
void
GenericLinkService::doSendInterest(const Interest& interest, const EndpointId& endpointId)
{
lp::Packet lpPacket(interest.wireEncode());
if (interest.getName().getPrefix(1).toUri() == "/localhost") {
lp::Packet lpPacket(interest.wireEncode());
encodeLpFields(interest, lpPacket);
this->sendNetPacket(std::move(lpPacket), endpointId, true);
} else {
auto success = this->nwfq.appendInterest(interest, endpointId);
//if (!success) {
// // send Nack
// lp::Nack nack(interest);
// nack.setReason(lp::NackReason::CONGESTION);
// if (this->nwfq.canMark(nack)) {
// // 拥塞标记
// nack.getInterest().setTag(make_shared<lp::CongestionMarkTag>(1));
// }
// this->receiveNack(nack, endpointId);
//}
}
//lp::Packet lpPacket(interest.wireEncode());
encodeLpFields(interest, lpPacket);
//encodeLpFields(interest, lpPacket);
this->sendNetPacket(std::move(lpPacket), endpointId, true);
//this->sendNetPacket(std::move(lpPacket), endpointId, true);
}
void
@@ -150,6 +192,16 @@ GenericLinkService::encodeLpFields(const ndn::PacketBase& netPkt, lp::Packet& lp
}
}
// add by qjm
auto dszTag = netPkt.getTag<lp::DSZTag>();
if (dszTag != nullptr) {
lpPacket.add<lp::DSZField>(*dszTag);
}
auto tosTag = netPkt.getTag<lp::TosTag>();
if (tosTag != nullptr) {
lpPacket.add<lp::TosField>(*tosTag);
}
auto pitToken = netPkt.getTag<lp::PitToken>();
if (pitToken != nullptr) {
lpPacket.add<lp::PitTokenField>(*pitToken);
@@ -411,6 +463,14 @@ GenericLinkService::decodeInterest(const Block& netPkt, const lp::Packet& firstP
interest->setTag(make_shared<lp::PitToken>(firstPkt.get<lp::PitTokenField>()));
}
// add by qjm
if (firstPkt.has<lp::DSZField>()) {
interest->setTag(make_shared<lp::DSZTag>(firstPkt.get<lp::DSZField>()));
}
if (firstPkt.has<lp::TosField>()) {
interest->setTag(make_shared<lp::TosTag>(firstPkt.get<lp::TosField>()));
}
this->receiveInterest(*interest, endpointId);
}
@@ -456,7 +516,10 @@ GenericLinkService::decodeData(const Block& netPkt, const lp::Packet& firstPkt,
if (firstPkt.has<lp::CongestionMarkField>()) {
data->setTag(make_shared<lp::CongestionMarkTag>(firstPkt.get<lp::CongestionMarkField>()));
}
}
//else if (this->nwfq.canMark(*data)) {
// data->setTag(make_shared<lp::CongestionMarkTag>(1));
//}
if (firstPkt.has<lp::NonDiscoveryField>()) {
++this->nInNetInvalid;
@@ -32,10 +32,14 @@
#include "lp-reliability.hpp"
#include <ndn-cxx/lp/tags.hpp>
#include <ndn-cxx/util/scheduler.hpp>
#include "nwfq.hpp"
namespace nfd {
namespace face {
using namespace ndn::util;
/** \brief counters provided by GenericLinkService
* \note The type name 'GenericLinkServiceCounters' is implementation detail.
* Use 'GenericLinkService::Counters' in public API.
@@ -158,6 +162,8 @@ public:
* To enable, set value of enableGeoTags option to a function that generates `shared_ptr<GeoTag>`
*/
std::function<std::shared_ptr<ndn::lp::GeoTag>()> enableGeoTags;
uint64_t C = 10000000;
};
/** \brief counters provided by GenericLinkService
@@ -307,6 +313,8 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
time::steady_clock::TimePoint m_nextMarkTime;
/// number of marked packets in the current incident of congestion
size_t m_nMarkedSinceInMarkingState;
NWFQ nwfq;
scheduler::EventCallback sendPacketCallback;
friend class LpReliability;
};
+196
View File
@@ -0,0 +1,196 @@
//
// Created by 阙建明 on 2021/6/14.
//
#include "nwfq.hpp"
#include <thread>
#include <chrono>
namespace nfd {
namespace face {
NFD_LOG_INIT(NWFQ);
uint64_t getTime() {
auto time_now = std::chrono::system_clock::now();
auto duration_in_ms = std::chrono::duration_cast<std::chrono::milliseconds>(time_now.time_since_epoch());
return duration_in_ms.count();
}
void VirtualQueue::pop() {
if (this->innerQueue.empty()) {
return;
}
uint64_t dataSize = 8552;
auto dszTag = this->innerQueue.front().interestPtr->getTag<lp::DSZTag>();
if (dszTag != nullptr) {
dataSize = dszTag->get();
}
this->currentSize -= dataSize;
this->innerQueue.pop();
}
bool VirtualQueue::enqueue(const Interest &interest, const EndpointId &endpointId, NWFQ &nwfq) {
uint64_t dataSize = 8552;
auto dszTag = interest.getTag<lp::DSZTag>();
if (dszTag != nullptr) {
dataSize = dszTag->get();
}
// 如果超出HQL 限制,则不入队,可以进行丢弃或者 Nack 处理
if (nwfq.totalQueueSize + dataSize >= nwfq.hql) {
return false;
}
// 判断,如果虚拟队列满,则不入队,可以进行丢弃或者Nack处理
if (this->currentSize + dataSize >= this->size) {
return false;
}
this->currentSize += dataSize;
uint64_t seq = this->lastSeq; // 队列为空,则设置序列号为最近一个调度出的包的序列号
if (!this->empty()) {
seq = this->lastSeq + 1.0 / this->weight * dataSize; // TODO: 此处this->dataSize应该缓存这个流平均Data包大小
} else {
seq = nwfq.lastSendSeq + 1.0 / this->weight * dataSize;
}
SendInterestTask sendInterestTask(endpointId, interest, seq);
this->lastSeq = seq;
// 进入虚拟队列
this->innerQueue.emplace(sendInterestTask);
nwfq.totalQueueSize += dataSize;
return true;
}
// bool VirtualQueue::canMark() {
// auto currentTime = getTime();
// //NFD_LOG_WARN("size: " << this->size << ", current: " << this->currentSize << ", lastSeq: " << this->lastSeq);
// if (this->currentSize < this->markThresh) {
// this->lastMarkTime = currentTime;
// return false;
// }
// if (currentTime - this->lastMarkTime > this->markInterval) {
// // NFD_LOG_INFO("last: " << this->lastMarkTime << ", current: " << currentTime);
// this->lastMarkTime = currentTime;
// return true;
// }
// return false;
// }
bool NWFQ::appendInterest(const Interest &interest, const EndpointId &endpointId) {
std::string key = interest.getName().getPrefix(1).toUri();
if (this->virtualQueues.count(key) == 0) {
this->virtualQueues[key] = std::make_shared<VirtualQueue>(1, this->queueSize);
// 当新建一个虚拟队列时,将所有虚拟队列最近发出的序列号作为起始序列号
this->virtualQueues[key]->setLastSeq(this->lastSendSeq);
// 通过提取 Interst 中的Tos Tag设置优先级
auto tosTag = interest.getTag<lp::TosTag>();
float weight = 1.0;
if (tosTag != nullptr) {
weight = tosTag->get();
}
this->virtualQueues[key]->setWeight(weight);
return this->virtualQueues[key]->enqueue(interest, endpointId, *this);
} else {
// 虚拟队列已经存在的情况
return this->virtualQueues[key]->enqueue(interest, endpointId, *this);
}
}
// bool NWFQ::canMark(const Name &name) {
// std::string key = name.getPrefix(1).toUri();
// if (this->virtualQueues.count(key) == 0) {
// return false;
// } else {
// return this->virtualQueues[key]->canMark();
// }
// }
//
// bool NWFQ::canMark(const Data &data) {
// return this->canMark(data.getName());
// }
//
// bool NWFQ::canMark(const lp::Nack &nack) {
// return this->canMark(nack.getInterest().getName());
// }
std::shared_ptr <VirtualQueue> NWFQ::wfqSchedule() {
std::shared_ptr <VirtualQueue> result = nullptr;
for (auto &item : this->virtualQueues) {
if (!item.second->empty()) {
if (result == nullptr || result->frontSeq() > item.second->frontSeq()) {
result = item.second;
}
}
}
if (result == nullptr) {
return nullptr;
}
uint64_t dataSize = 8552;
auto dszTag = result->front().interestPtr->getTag<lp::DSZTag>();
if (dszTag != nullptr) {
dataSize = dszTag->get();
}
// 令牌数量不够时,直接返回 nullptr 表示不可调度
if (this->tokens < dataSize) {
return nullptr;
}
// 如果有可调度的队列,且令牌数量足够,则消耗令牌
if (result != nullptr) {
this->tokens -= dataSize;
}
this->lastSendSeq = result->frontSeq();
// 通过排队时间判断是否需要标记
this->checkCongestionLevel(*result->front().interestPtr);
this->totalQueueSize -= dataSize;
auto value = this->tokens;
//NFD_LOG_WARN("tokens: " << value << ", " << result->frontSeq() << ", "<< result->front().interestPtr->getName().toUri());
return result;
}
void NWFQ::checkCongestionLevel(const Interest &interest) {
if (this->totalQueueSize == 0) {
return;
}
if (this->C == 1000000) {
NFD_LOG_DEBUG("TotalQueueSize: " << this->totalQueueSize);
}
if (this->totalQueueSize > this->markThresh) {
NFD_LOG_DEBUG("Fuck");
const auto now = time::steady_clock::now();
if (m_nextMarkTime == time::steady_clock::TimePoint::max()) {
m_nextMarkTime = now + this->markInterval;
}
// Mark packet if sendQueue stays above target for one interval
else if (now >= m_nextMarkTime) {
interest.setTag(make_shared<lp::CongestionMarkTag>(1));
++m_nMarkedSinceInMarkingState;
// Decrease the marking interval by the inverse of the square root of the number of packets
// marked in this incident of congestion
time::nanoseconds interval(static_cast<time::nanoseconds::rep>(
this->markInterval.count() /
std::sqrt(m_nMarkedSinceInMarkingState + 1)));
m_nextMarkTime += interval;
}
} else if (m_nextMarkTime != time::steady_clock::TimePoint::max()) {
m_nextMarkTime = time::steady_clock::TimePoint::max();
m_nMarkedSinceInMarkingState = 0;
}
}
}
}
+226
View File
@@ -0,0 +1,226 @@
//
// Created by 阙建明 on 2021/6/14.
//
#ifndef TEMPLATE_NWFQ_H
#define TEMPLATE_NWFQ_H
#include <queue>
#include <unordered_map>
#include <string>
#include "link-service.hpp"
#include <memory>
#include <ndn-cxx/util/scheduler.hpp>
#include <ndn-cxx/lp/tags.hpp>
#include "common/global.hpp"
#include "face-common.hpp"
namespace nfd {
namespace face {
using namespace ndn;
using namespace ndn::util;
class NWFQ;
/**
* 兴趣包发送 Task
*/
struct SendInterestTask {
SendInterestTask(const EndpointId &endpointId, const Interest &interest, uint64_t seq) :
endpointId(endpointId),
interestPtr(interest.shared_from_this()),
seq(seq) {
}
EndpointId endpointId;
shared_ptr<const Interest> interestPtr;
uint64_t seq; // WFQ序列号
};
/**
* 虚拟队列实现
*/
class VirtualQueue {
public:
explicit VirtualQueue(float weight, uint64_t size) :
weight(weight), size(size), currentSize(0){
}
/**
* 往虚拟队列里面放入一个
* @param interest
* @param endpointId
* @param seq
* @param isFirst 是否是创建虚拟队列之后第一次放包
* @return
*/
bool enqueue(const Interest &interest, const EndpointId &endpointId, NWFQ &nwfq);
/**
* 判断虚拟队列是否为空
*/
bool empty() {
return this->innerQueue.empty();
}
/**
* 返回队头元素的序列号
* @return
*/
uint64_t frontSeq() {
if (this->innerQueue.empty()) {
return this->lastSeq;
}
return this->innerQueue.front().seq;
}
/**
* 返回虚拟队列队头的元素(调用之前用 empty 判断不为空)
* @return
*/
SendInterestTask front() {
return this->innerQueue.front();
}
/**
* 弹出队头Task
*/
void pop();
/**
* 设置最近一次分配的序列号
* 1. 当这是一个新创建的虚拟队列时,会遍历所有虚拟队列,取所有虚拟队列队头序列号中最小的序列号;
* 2. 当这个队列空了一段时间时(超过1秒),会遍历所有虚拟队列,取所有虚拟队列队头序列号中最小的序列号;
* @param seq
*/
void setLastSeq(uint64_t seq) {
this->lastSeq = seq;
}
/**
* 获取最近一次分配的序列号
* @return
*/
uint64_t getLastSeq() {
return lastSeq;
}
void setWeight(float weight) {
this->weight = weight;
}
// /**
// * 返回是否可以标记,一个标记周期内,最多可以标记一次
// */
// bool canMark();
private:
float weight; // 队列权重(优先级越高,权重越大)
uint64_t size; // 队列大小(单位为字节)
int currentSize; // 当前队列占用大小(单位为字节,每个 Task 占用的大小等于其兴趣包对应的数据包的大小)
uint64_t lastSeq; // 最近一次分配的序列号
uint64_t lastMarkTime; // 最后一次标记的时间
std::queue <SendInterestTask> innerQueue; // 存放队列里面的兴趣包发送任务
};
class NWFQ {
public:
explicit NWFQ() : C(1000000), queueSize(1600000), tokens(0) {
this->hql = 200 * 1000 * 8;
this->markThresh = 64 * 1000 * 2;
};
/**
* 设置带宽大小
* @param C
*/
void setC(uint64_t C) {
this->C = C;
}
/**
* 设置队列的大小
* @param queueSize
*/
void setQueueSize(uint64_t queueSize) {
this->queueSize = queueSize;
}
/**
* 添加一个兴趣包
* 1. 首先根据兴趣包的名字,取第一个 Component 区分不同的流,放到不同的虚拟队列当中
* 2.
* @param interest
* @param endpointId
* @return bool 返回是否入队成功,如果入队失败,则表示对应的虚拟队列已经满了,需要丢弃或者做Nack处理
*/
bool appendInterest(const Interest &interest, const EndpointId &endpointId);
// /**
// * 判断某个前缀对应的包是否可以标记
// */
// bool canMark(const Name &name);
//
// /**
// * 判断是否可以给一个Data包标记
// */
// bool canMark(const Data &data);
//
// /**
// * 判断是否可以给一个 Nack 标记
// */
// bool canMark(const lp::Nack &nack);
/**
* 返回下一个可调度的虚拟队列
* @return
*/
std::shared_ptr <VirtualQueue> wfqSchedule();
/**
* 启动一个定时任务,按链路的带宽作为令牌生成速率,往令牌桶中投放令牌
*/
void startTokenBucket() {
this->generateTokenCallback = [this]() {
if (this->tokens + (this->C / 1000) < this->C) {
this->tokens += (this->C / 1000);
} else {
this->tokens = this->C;
}
getScheduler().schedule(time::nanoseconds(1000 * 1000), this->generateTokenCallback);
};
getScheduler().schedule(time::nanoseconds(1000 * 1000), this->generateTokenCallback);
}
/**
* 检查是否需要对兴趣包进行标记
* @param interest
*/
void checkCongestionLevel(const Interest &interest);
public:
uint64_t hql; // Hold-Queue-Limit
uint64_t totalQueueSize = 0; // 所有虚拟队列总的占用率
uint64_t lastSendSeq = 1;
uint64_t markThresh; // 标记阈值,为队列大小的10%
time::nanoseconds markInterval = 100_ms; // 标记周期 => 100 ms
time::steady_clock::TimePoint m_nextMarkTime;
/// number of marked packets in the current incident of congestion
size_t m_nMarkedSinceInMarkingState;
private:
uint64_t C; // 带宽
uint64_t queueSize; // 队列大小
uint64_t tokens; // 令牌桶中的令牌
scheduler::EventCallback generateTokenCallback;
std::unordered_map <std::string, std::shared_ptr<VirtualQueue>> virtualQueues; // 虚拟队列
};
}
}
#endif //TEMPLATE_NWFQ_H
@@ -28,6 +28,7 @@
#include "common/logger.hpp"
#include <ndn-cxx/lp/pit-token.hpp>
#include <ndn-cxx/lp/tags.hpp>
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
@@ -232,6 +233,12 @@ Strategy::sendData(const shared_ptr<pit::Entry>& pitEntry, const Data& data,
auto inRecord = pitEntry->getInRecord(egress.face);
if (inRecord != pitEntry->in_end()) {
pitToken = inRecord->getInterest().getTag<lp::PitToken>();
// 把兴趣包中的 CongestionTag 传递给对应的数据包
auto congestionTag = inRecord->getInterest().getTag<ndn::lp::CongestionMarkTag>();
if (congestionTag != nullptr) {
data.setTag(congestionTag);
}
}
// delete the PIT entry's in-record based on egress,
+3 -3
View File
@@ -130,7 +130,7 @@ ConsumerPcon::OnData(shared_ptr<const Data> data)
m_inFlight--;
}
NS_LOG_DEBUG("Window: " << m_window << ", InFlight: " << m_inFlight);
//NS_LOG_DEBUG("Window: " << m_window << ", InFlight: " << m_inFlight);
ScheduleNextPacket();
}
@@ -144,7 +144,7 @@ ConsumerPcon::OnTimeout(uint32_t sequenceNum)
m_inFlight--;
}
NS_LOG_DEBUG("Window: " << m_window << ", InFlight: " << m_inFlight);
//NS_LOG_DEBUG("Window: " << m_window << ", InFlight: " << m_inFlight);
Consumer::OnTimeout(sequenceNum);
}
@@ -169,7 +169,7 @@ ConsumerPcon::WindowIncrease()
else {
BOOST_ASSERT_MSG(false, "Unknown CC Algorithm");
}
NS_LOG_DEBUG("Window size increased to " << m_window);
//NS_LOG_DEBUG("Window size increased to " << m_window);
}
void
@@ -281,6 +281,12 @@ StackHelper::PointToPointNetDeviceCallback(Ptr<Node> node, Ptr<L3Protocol> ndn,
opts.allowFragmentation = true;
opts.allowReassembly = true;
opts.allowCongestionMarking = true;
// Get DataRate
DataRateValue dataRateAttribute;
if (netDevice->GetAttributeFailSafe("DataRate", dataRateAttribute)) {
auto dataRate = dataRateAttribute.Get();
opts.C = dataRate.GetBitRate();
}
auto linkService = make_unique<::nfd::face::GenericLinkService>(opts);
+3
View File
@@ -265,6 +265,9 @@ extractLpLocalFields(NetPkt& netPacket, const lp::Packet& lpPacket)
addTagFromField<lp::IncomingFaceIdTag, lp::IncomingFaceIdField>(netPacket, lpPacket);
addTagFromField<lp::CongestionMarkTag, lp::CongestionMarkField>(netPacket, lpPacket);
// add by qjm
addTagFromField<lp::DSZTag, lp::DSZField>(netPacket, lpPacket);
if (lpPacket.has<lp::HopCountTagField>()) {
netPacket.setTag(make_shared<lp::HopCountTag>(lpPacket.get<lp::HopCountTagField>() + 1));
}
@@ -98,6 +98,10 @@ public: // consumer
addFieldFromTag<lp::NextHopFaceIdField, lp::NextHopFaceIdTag>(lpPacket, interest2);
addFieldFromTag<lp::CongestionMarkField, lp::CongestionMarkTag>(lpPacket, interest2);
// add by qjm
addFieldFromTag<lp::DSZField, lp::DSZTag>(lpPacket, interest2);
addFieldFromTag<lp::TosField, lp::TosTag>(lpPacket, interest2);
entry.recordForwarding();
m_face.m_transport->send(finishEncoding(std::move(lpPacket), interest2.wireEncode(),
'I', interest2.getName()));
+18 -1
View File
@@ -138,6 +138,21 @@ typedef FieldDecl<field_location_tags::Fragment,
tlv::Fragment> FragmentField;
BOOST_CONCEPT_ASSERT((Field<FragmentField>));
/**
* DSZ Field
* Data Size field
*/
typedef FieldDecl<field_location_tags::Header,
uint64_t, tlv::DSZ> DSZField;
/**
* Tos Field
*/
typedef FieldDecl<field_location_tags::Header,
uint64_t, tlv::Tos> TosField;
/** \brief Set of all field declarations.
*/
typedef boost::mpl::set<
@@ -156,7 +171,9 @@ typedef boost::mpl::set<
NonDiscoveryField,
PrefixAnnouncementField,
HopCountTagField,
GeoTagField
GeoTagField,
DSZField,
TosField
> FieldSet;
} // namespace lp
@@ -80,6 +80,17 @@ typedef SimpleTag<PrefixAnnouncementHeader, 15> PrefixAnnouncementTag;
*/
typedef SimpleTag<uint64_t, 0x60000000> HopCountTag;
/**
* DSZ
* Data Size
*/
typedef SimpleTag<uint64_t, 16> DSZTag;
/**
* Tos
*/
typedef SimpleTag<uint64_t, 17> TosTag;
/** \class GeoTag
* \brief a packet tag for GeoTag field
*
@@ -50,6 +50,11 @@ enum {
TxSequence = 840,
NonDiscovery = 844,
PrefixAnnouncement = 848,
// Add DSZ Tag
DSZ = 852,
// Add Tos Tag
Tos = 856
};
enum {
+25
View File
@@ -0,0 +1,25 @@
set(ns3-netanim_SOURCES
model/animation-interface.cc)
set(ns3-netanim_INCLUDES
.
#
.)
include_directories(${ns3-netanim_INCLUDES})
add_library(ns3-netanim SHARED ${ns3-netanim_SOURCES})
target_link_libraries(ns3-netanim ns3-internet)
target_link_libraries(ns3-netanim ns3-mobility)
target_link_libraries(ns3-netanim ns3-wimax)
target_link_libraries(ns3-netanim ns3-wifi)
target_link_libraries(ns3-netanim ns3-csma)
target_link_libraries(ns3-netanim ns3-lte)
target_link_libraries(ns3-netanim ns3-uan)
target_link_libraries(ns3-netanim ns3-lr-wpan)
target_link_libraries(ns3-netanim ns3-energy)
target_link_libraries(ns3-netanim ns3-wave)
target_link_libraries(ns3-netanim ns3-point-to-point-layout)
+81
View File
@@ -0,0 +1,81 @@
set(ns3-network_SOURCES
model/address.cc
model/application.cc
model/buffer.cc
model/byte-tag-list.cc
model/channel.cc
model/channel-list.cc
model/chunk.cc
model/header.cc
model/nix-vector.cc
model/node.cc
model/node-list.cc
model/net-device.cc
model/packet.cc
model/packet-metadata.cc
model/packet-tag-list.cc
model/socket.cc
model/socket-factory.cc
model/tag.cc
model/tag-buffer.cc
model/trailer.cc
utils/address-utils.cc
utils/ascii-file.cc
utils/crc32.cc
utils/data-rate.cc
utils/drop-tail-queue.cc
utils/dynamic-queue-limits.cc
utils/error-channel.cc
utils/error-model.cc
utils/ethernet-header.cc
utils/ethernet-trailer.cc
utils/flow-id-tag.cc
utils/inet-socket-address.cc
utils/inet6-socket-address.cc
utils/ipv4-address.cc
utils/ipv6-address.cc
utils/mac16-address.cc
utils/mac48-address.cc
utils/mac64-address.cc
utils/llc-snap-header.cc
utils/output-stream-wrapper.cc
utils/packetbb.cc
utils/packet-burst.cc
utils/packet-socket.cc
utils/packet-socket-address.cc
utils/packet-socket-factory.cc
utils/pcap-file.cc
utils/pcap-file-wrapper.cc
utils/queue.cc
utils/queue-item.cc
utils/queue-limits.cc
utils/queue-size.cc
utils/net-device-queue-interface.cc
utils/radiotap-header.cc
utils/simple-channel.cc
utils/simple-net-device.cc
utils/sll-header.cc
utils/packet-socket-client.cc
utils/packet-socket-server.cc
utils/packet-data-calculators.cc
utils/packet-probe.cc
utils/mac8-address.cc
helper/application-container.cc
helper/net-device-container.cc
helper/node-container.cc
helper/packet-socket-helper.cc
helper/trace-helper.cc
helper/delay-jitter-estimation.cc
helper/simple-net-device-helper.cc)
set(ns3-network_INCLUDES
#)
include_directories(${ns3-network_INCLUDES})
add_library(ns3-network SHARED ${ns3-network_SOURCES})
target_link_libraries(ns3-network ns3-core)
target_link_libraries(ns3-network ns3-stats)
@@ -0,0 +1,16 @@
set(ns3-nix-vector-routing_SOURCES
model/ipv4-nix-vector-routing.cc
helper/ipv4-nix-vector-helper.cc)
set(ns3-nix-vector-routing_INCLUDES
.
#
.)
include_directories(${ns3-nix-vector-routing_INCLUDES})
add_library(ns3-nix-vector-routing SHARED ${ns3-nix-vector-routing_SOURCES})
target_link_libraries(ns3-nix-vector-routing ns3-internet)
+18
View File
@@ -0,0 +1,18 @@
set(ns3-olsr_SOURCES
model/olsr-header.cc
model/olsr-state.cc
model/olsr-routing-protocol.cc
helper/olsr-helper.cc)
set(ns3-olsr_INCLUDES
.
#
.)
include_directories(${ns3-olsr_INCLUDES})
add_library(ns3-olsr SHARED ${ns3-olsr_SOURCES})
target_link_libraries(ns3-olsr ns3-internet)
@@ -0,0 +1,19 @@
set(ns3-point-to-point-layout_SOURCES
model/point-to-point-dumbbell.cc
model/point-to-point-grid.cc
model/point-to-point-star.cc)
set(ns3-point-to-point-layout_INCLUDES
.
#
.)
include_directories(${ns3-point-to-point-layout_INCLUDES})
add_library(ns3-point-to-point-layout SHARED ${ns3-point-to-point-layout_SOURCES})
target_link_libraries(ns3-point-to-point-layout ns3-internet)
target_link_libraries(ns3-point-to-point-layout ns3-point-to-point)
target_link_libraries(ns3-point-to-point-layout ns3-mobility)
+18
View File
@@ -0,0 +1,18 @@
set(ns3-point-to-point_SOURCES
model/point-to-point-net-device.cc
model/point-to-point-channel.cc
model/point-to-point-remote-channel.cc
model/ppp-header.cc
helper/point-to-point-helper.cc)
set(ns3-point-to-point_INCLUDES
#)
include_directories(${ns3-point-to-point_INCLUDES})
add_library(ns3-point-to-point SHARED ${ns3-point-to-point_SOURCES})
target_link_libraries(ns3-point-to-point ns3-network)
target_link_libraries(ns3-point-to-point ns3-mpi)
+24
View File
@@ -0,0 +1,24 @@
set(ns3-propagation_SOURCES
model/propagation-delay-model.cc
model/propagation-loss-model.cc
model/jakes-propagation-loss-model.cc
model/jakes-process.cc
model/cost231-propagation-loss-model.cc
model/okumura-hata-propagation-loss-model.cc
model/itu-r-1411-los-propagation-loss-model.cc
model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.cc
model/kun-2600-mhz-propagation-loss-model.cc)
set(ns3-propagation_INCLUDES
.
#
.)
include_directories(${ns3-propagation_INCLUDES})
add_library(ns3-propagation SHARED ${ns3-propagation_SOURCES})
target_link_libraries(ns3-propagation ns3-network)
target_link_libraries(ns3-propagation ns3-mobility)
+19
View File
@@ -0,0 +1,19 @@
set(ns3-sixlowpan_SOURCES
model/sixlowpan-net-device.cc
model/sixlowpan-header.cc
helper/sixlowpan-helper.cc)
set(ns3-sixlowpan_INCLUDES
.
#
.)
include_directories(${ns3-sixlowpan_INCLUDES})
add_library(ns3-sixlowpan SHARED ${ns3-sixlowpan_SOURCES})
target_link_libraries(ns3-sixlowpan ns3-internet)
target_link_libraries(ns3-sixlowpan ns3-network)
target_link_libraries(ns3-sixlowpan ns3-core)
+44
View File
@@ -0,0 +1,44 @@
set(ns3-spectrum_SOURCES
model/spectrum-model.cc
model/spectrum-value.cc
model/spectrum-converter.cc
model/spectrum-signal-parameters.cc
model/spectrum-propagation-loss-model.cc
model/friis-spectrum-propagation-loss.cc
model/constant-spectrum-propagation-loss.cc
model/spectrum-phy.cc
model/spectrum-channel.cc
model/single-model-spectrum-channel.cc
model/multi-model-spectrum-channel.cc
model/spectrum-interference.cc
model/spectrum-error-model.cc
model/spectrum-model-ism2400MHz-res1MHz.cc
model/spectrum-model-300kHz-300GHz-log.cc
model/wifi-spectrum-value-helper.cc
model/waveform-generator.cc
model/spectrum-analyzer.cc
model/aloha-noack-mac-header.cc
model/aloha-noack-net-device.cc
model/half-duplex-ideal-phy.cc
model/half-duplex-ideal-phy-signal-parameters.cc
model/non-communicating-net-device.cc
model/microwave-oven-spectrum-value-helper.cc
model/tv-spectrum-transmitter.cc
model/trace-fading-loss-model.cc
helper/spectrum-helper.cc
helper/adhoc-aloha-noack-ideal-phy-helper.cc
helper/waveform-generator-helper.cc
helper/spectrum-analyzer-helper.cc
helper/tv-spectrum-transmitter-helper.cc)
set(ns3-spectrum_INCLUDES
#)
include_directories(${ns3-spectrum_INCLUDES})
add_library(ns3-spectrum SHARED ${ns3-spectrum_SOURCES})
target_link_libraries(ns3-spectrum ns3-propagation)
target_link_libraries(ns3-spectrum ns3-antenna)
+34
View File
@@ -0,0 +1,34 @@
set(ns3-stats_SOURCES
helper/file-helper.cc
helper/gnuplot-helper.cc
model/data-calculator.cc
model/time-data-calculators.cc
model/data-output-interface.cc
model/omnet-data-output.cc
model/data-collector.cc
model/gnuplot.cc
model/data-collection-object.cc
model/probe.cc
model/boolean-probe.cc
model/double-probe.cc
model/time-probe.cc
model/uinteger-8-probe.cc
model/uinteger-16-probe.cc
model/uinteger-32-probe.cc
model/time-series-adaptor.cc
model/file-aggregator.cc
model/gnuplot-aggregator.cc
model/get-wildcard-matches.cc
model/sqlite-data-output.cc)
set(ns3-stats_INCLUDES
#)
include_directories(${ns3-stats_INCLUDES})
add_library(ns3-stats SHARED ${ns3-stats_SOURCES})
target_link_libraries(ns3-stats ns3-core)
target_link_libraries(ns3-stats SQLITE3)
+22
View File
@@ -0,0 +1,22 @@
set(ns3-tap-bridge_SOURCES
model/tap-bridge.cc
model/tap-encode-decode.cc
helper/tap-bridge-helper.cc)
set(ns3-tap-bridge_INCLUDES
#)
include_directories(${ns3-tap-bridge_INCLUDES})
add_library(ns3-tap-bridge SHARED ${ns3-tap-bridge_SOURCES})
target_link_libraries(ns3-tap-bridge ns3-internet)
target_link_libraries(ns3-tap-bridge ns3-network)
target_link_libraries(ns3-tap-bridge ns3-core)
set(tap-creator_SOURCES
model/tap-creator.cc
model/tap-encode-decode.cc)
add_executable(tap-creator ${tap-creator_SOURCES})
+32
View File
@@ -0,0 +1,32 @@
set(ns3-test_SOURCES)
set(ns3-test_INCLUDES
#)
include_directories(${ns3-test_INCLUDES})
add_library(ns3-test SHARED ${ns3-test_SOURCES})
target_link_libraries(ns3-test ns3-applications)
target_link_libraries(ns3-test ns3-bridge)
target_link_libraries(ns3-test ns3-config-store)
target_link_libraries(ns3-test ns3-csma)
target_link_libraries(ns3-test ns3-csma-layout)
target_link_libraries(ns3-test ns3-dsr)
target_link_libraries(ns3-test ns3-flow-monitor)
target_link_libraries(ns3-test ns3-internet)
target_link_libraries(ns3-test ns3-lr-wpan)
target_link_libraries(ns3-test ns3-lte)
target_link_libraries(ns3-test ns3-mesh)
target_link_libraries(ns3-test ns3-mobility)
target_link_libraries(ns3-test ns3-olsr)
target_link_libraries(ns3-test ns3-point-to-point)
target_link_libraries(ns3-test ns3-sixlowpan)
target_link_libraries(ns3-test ns3-stats)
target_link_libraries(ns3-test ns3-uan)
target_link_libraries(ns3-test ns3-wifi)
target_link_libraries(ns3-test ns3-internet-apps)
target_link_libraries(ns3-test ns3-point-to-point-layout)
target_link_libraries(ns3-test ns3-traffic-control)
+17
View File
@@ -0,0 +1,17 @@
set(ns3-topology-read_SOURCES
model/topology-reader.cc
model/inet-topology-reader.cc
model/orbis-topology-reader.cc
model/rocketfuel-topology-reader.cc
helper/topology-reader-helper.cc)
set(ns3-topology-read_INCLUDES
#)
include_directories(${ns3-topology-read_INCLUDES})
add_library(ns3-topology-read SHARED ${ns3-topology-read_SOURCES})
target_link_libraries(ns3-topology-read ns3-network)
+28
View File
@@ -0,0 +1,28 @@
set(ns3-traffic-control_SOURCES
model/traffic-control-layer.cc
model/packet-filter.cc
model/queue-disc.cc
model/pfifo-fast-queue-disc.cc
model/fifo-queue-disc.cc
model/red-queue-disc.cc
model/codel-queue-disc.cc
model/fq-codel-queue-disc.cc
model/pie-queue-disc.cc
model/prio-queue-disc.cc
model/mq-queue-disc.cc
model/tbf-queue-disc.cc
model/cobalt-queue-disc.cc
helper/traffic-control-helper.cc
helper/queue-disc-container.cc)
set(ns3-traffic-control_INCLUDES
#)
include_directories(${ns3-traffic-control_INCLUDES})
add_library(ns3-traffic-control SHARED ${ns3-traffic-control_SOURCES})
target_link_libraries(ns3-traffic-control ns3-core)
target_link_libraries(ns3-traffic-control ns3-network)
+37
View File
@@ -0,0 +1,37 @@
set(ns3-uan_SOURCES
model/uan-channel.cc
model/uan-phy-gen.cc
model/uan-mac.cc
model/uan-transducer.cc
model/uan-transducer-hd.cc
model/uan-net-device.cc
model/uan-tx-mode.cc
model/uan-prop-model.cc
model/uan-prop-model-ideal.cc
model/uan-mac-aloha.cc
model/uan-header-common.cc
model/uan-noise-model-default.cc
model/uan-mac-cw.cc
model/uan-prop-model-thorp.cc
model/uan-phy-dual.cc
model/uan-header-rc.cc
model/uan-mac-rc.cc
model/uan-mac-rc-gw.cc
model/uan-phy.cc
model/uan-noise-model.cc
model/acoustic-modem-energy-model.cc
helper/uan-helper.cc
helper/acoustic-modem-energy-model-helper.cc)
set(ns3-uan_INCLUDES
#)
include_directories(${ns3-uan_INCLUDES})
add_library(ns3-uan SHARED ${ns3-uan_SOURCES})
target_link_libraries(ns3-uan ns3-network)
target_link_libraries(ns3-uan ns3-energy)
target_link_libraries(ns3-uan ns3-mobility)
@@ -0,0 +1,13 @@
set(ns3-virtual-net-device_SOURCES
model/virtual-net-device.cc)
set(ns3-virtual-net-device_INCLUDES
#)
include_directories(${ns3-virtual-net-device_INCLUDES})
add_library(ns3-virtual-net-device SHARED ${ns3-virtual-net-device_SOURCES})
target_link_libraries(ns3-virtual-net-device ns3-network)
+31
View File
@@ -0,0 +1,31 @@
set(ns3-wave_SOURCES
model/wave-mac-low.cc
model/ocb-wifi-mac.cc
model/vendor-specific-action.cc
model/channel-coordinator.cc
model/channel-scheduler.cc
model/default-channel-scheduler.cc
model/channel-manager.cc
model/vsa-manager.cc
model/bsm-application.cc
model/higher-tx-tag.cc
model/wave-net-device.cc
helper/wave-bsm-stats.cc
helper/wave-mac-helper.cc
helper/wave-helper.cc
helper/wifi-80211p-helper.cc
helper/wave-bsm-helper.cc)
set(ns3-wave_INCLUDES
#)
include_directories(${ns3-wave_INCLUDES})
add_library(ns3-wave SHARED ${ns3-wave_SOURCES})
target_link_libraries(ns3-wave ns3-core)
target_link_libraries(ns3-wave ns3-wifi)
target_link_libraries(ns3-wave ns3-propagation)
target_link_libraries(ns3-wave ns3-internet)
+119
View File
@@ -0,0 +1,119 @@
set(ns3-wifi_SOURCES
model/wifi-utils.cc
model/wifi-information-element.cc
model/wifi-information-element-vector.cc
model/wifi-mode.cc
model/ssid.cc
model/wifi-phy.cc
model/wifi-phy-state-helper.cc
model/error-rate-model.cc
model/yans-error-rate-model.cc
model/nist-error-rate-model.cc
model/dsss-error-rate-model.cc
model/interference-helper.cc
model/yans-wifi-phy.cc
model/yans-wifi-channel.cc
model/spectrum-wifi-phy.cc
model/wifi-phy-tag.cc
model/tx-vector-tag.cc
model/wifi-spectrum-phy-interface.cc
model/wifi-spectrum-signal-parameters.cc
model/wifi-phy-header.cc
model/wifi-mac-header.cc
model/wifi-mac-trailer.cc
model/mac-low.cc
model/mac-low-transmission-parameters.cc
model/wifi-mac-queue.cc
model/mac-tx-middle.cc
model/mac-rx-middle.cc
model/txop.cc
model/supported-rates.cc
model/capability-information.cc
model/status-code.cc
model/mgt-headers.cc
model/channel-access-manager.cc
model/wifi-mac.cc
model/regular-wifi-mac.cc
model/infrastructure-wifi-mac.cc
model/wifi-remote-station-info.cc
model/wifi-remote-station-manager.cc
model/ap-wifi-mac.cc
model/sta-wifi-mac.cc
model/adhoc-wifi-mac.cc
model/wifi-net-device.cc
model/arf-wifi-manager.cc
model/aarf-wifi-manager.cc
model/ideal-wifi-manager.cc
model/constant-rate-wifi-manager.cc
model/amrr-wifi-manager.cc
model/onoe-wifi-manager.cc
model/rraa-wifi-manager.cc
model/aarfcd-wifi-manager.cc
model/cara-wifi-manager.cc
model/minstrel-wifi-manager.cc
model/minstrel-ht-wifi-manager.cc
model/qos-utils.cc
model/qos-txop.cc
model/msdu-aggregator.cc
model/amsdu-subframe-header.cc
model/originator-block-ack-agreement.cc
model/ctrl-headers.cc
model/qos-blocked-destinations.cc
model/block-ack-agreement.cc
model/block-ack-manager.cc
model/block-ack-cache.cc
model/block-ack-window.cc
model/snr-tag.cc
model/ht-capabilities.cc
model/wifi-tx-vector.cc
model/parf-wifi-manager.cc
model/aparf-wifi-manager.cc
model/rrpaa-wifi-manager.cc
model/ampdu-subframe-header.cc
model/mpdu-aggregator.cc
model/ampdu-tag.cc
model/wifi-radio-energy-model.cc
model/wifi-tx-current-model.cc
model/vht-capabilities.cc
model/erp-information.cc
model/ht-operation.cc
model/vht-operation.cc
model/dsss-parameter-set.cc
model/edca-parameter-set.cc
model/he-capabilities.cc
model/frame-capture-model.cc
model/simple-frame-capture-model.cc
model/preamble-detection-model.cc
model/threshold-preamble-detection-model.cc
model/he-operation.cc
model/he-configuration.cc
model/extended-capabilities.cc
model/cf-parameter-set.cc
model/wifi-mac-queue-item.cc
model/wifi-psdu.cc
model/ht-configuration.cc
model/vht-configuration.cc
model/obss-pd-algorithm.cc
model/constant-obss-pd-algorithm.cc
helper/wifi-radio-energy-model-helper.cc
helper/athstats-helper.cc
helper/wifi-helper.cc
helper/yans-wifi-helper.cc
helper/spectrum-wifi-helper.cc
helper/wifi-mac-helper.cc)
set(ns3-wifi_INCLUDES
#)
include_directories(${ns3-wifi_INCLUDES})
add_library(ns3-wifi SHARED ${ns3-wifi_SOURCES})
target_link_libraries(ns3-wifi ns3-network)
target_link_libraries(ns3-wifi ns3-propagation)
target_link_libraries(ns3-wifi ns3-energy)
target_link_libraries(ns3-wifi ns3-spectrum)
target_link_libraries(ns3-wifi ns3-antenna)
target_link_libraries(ns3-wifi ns3-mobility)
+63
View File
@@ -0,0 +1,63 @@
set(ns3-wimax_SOURCES
model/cid.cc
model/cid-factory.cc
model/wimax-net-device.cc
model/bs-net-device.cc
model/ss-net-device.cc
model/wimax-mac-header.cc
model/wimax-phy.cc
model/wimax-channel.cc
model/ofdm-downlink-frame-prefix.cc
model/wimax-connection.cc
model/ss-record.cc
model/mac-messages.cc
model/dl-mac-messages.cc
model/ul-mac-messages.cc
model/simple-ofdm-wimax-phy.cc
model/simple-ofdm-wimax-channel.cc
model/send-params.cc
model/ss-manager.cc
model/connection-manager.cc
model/bs-uplink-scheduler.cc
model/bs-uplink-scheduler-simple.cc
model/bs-uplink-scheduler-mbqos.cc
model/bs-uplink-scheduler-rtps.cc
model/bs-scheduler.cc
model/bs-scheduler-simple.cc
model/bs-scheduler-rtps.cc
model/wimax-mac-queue.cc
model/burst-profile-manager.cc
model/ss-scheduler.cc
model/service-flow.cc
model/service-flow-manager.cc
model/service-flow-record.cc
model/ss-link-manager.cc
model/bs-link-manager.cc
model/bandwidth-manager.cc
model/crc8.cc
model/ul-job.cc
model/snr-to-block-error-rate-record.cc
model/snr-to-block-error-rate-manager.cc
model/simple-ofdm-send-param.cc
model/ss-service-flow-manager.cc
model/bs-service-flow-manager.cc
model/ipcs-classifier.cc
model/ipcs-classifier-record.cc
model/wimax-tlv.cc
model/cs-parameters.cc
model/wimax-mac-to-mac-header.cc
helper/wimax-helper.cc)
set(ns3-wimax_INCLUDES
#)
include_directories(${ns3-wimax_INCLUDES})
add_library(ns3-wimax SHARED ${ns3-wimax_SOURCES})
target_link_libraries(ns3-wimax ns3-network)
target_link_libraries(ns3-wimax ns3-internet)
target_link_libraries(ns3-wimax ns3-propagation)
target_link_libraries(ns3-wimax ns3-mobility)
+177
View File
@@ -0,0 +1,177 @@
set(test-runner_SOURCES
test-runner.cc)
set(test-runner_INCLUDES
#
../build/ns3/ndnSIM/NFD
../ns3/ndnSIM/NFD
../build/src/ndnSIM/NFD/core
../src/ndnSIM/NFD/core
../build/src/ndnSIM/NFD/daemon
../src/ndnSIM/NFD/daemon
../build/src/ndnSIM/NFD/rib
../src/ndnSIM/NFD/rib
../build/ns3/ndnSIM
../ns3/ndnSIM
#
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/ns3/ndnSIM/NFD
/home/sunny/Documents/nwfq-ndnsim/ns-3/ns3/ndnSIM/NFD
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/core
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/core
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/daemon
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/daemon
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/rib
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/rib
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/ns3/ndnSIM
/home/sunny/Documents/nwfq-ndnsim/ns-3/ns3/ndnSIM
/usr/include
/usr/include)
include_directories(${test-runner_INCLUDES})
add_executable(test-runner ${test-runner_SOURCES})
target_link_libraries(test-runner ns3-antenna)
target_link_libraries(test-runner ns3-aodv)
target_link_libraries(test-runner ns3-applications)
target_link_libraries(test-runner ns3-bridge)
target_link_libraries(test-runner ns3-buildings)
target_link_libraries(test-runner ns3-config-store)
target_link_libraries(test-runner ns3-core)
target_link_libraries(test-runner ns3-csma)
target_link_libraries(test-runner ns3-csma-layout)
target_link_libraries(test-runner ns3-dsdv)
target_link_libraries(test-runner ns3-dsr)
target_link_libraries(test-runner ns3-energy)
target_link_libraries(test-runner ns3-fd-net-device)
target_link_libraries(test-runner ns3-flow-monitor)
target_link_libraries(test-runner ns3-internet)
target_link_libraries(test-runner ns3-internet-apps)
target_link_libraries(test-runner ns3-lr-wpan)
target_link_libraries(test-runner ns3-lte)
target_link_libraries(test-runner ns3-mesh)
target_link_libraries(test-runner ns3-mobility)
target_link_libraries(test-runner ns3-mpi)
target_link_libraries(test-runner ns3-ndnSIM)
target_link_libraries(test-runner ns3-netanim)
target_link_libraries(test-runner ns3-network)
target_link_libraries(test-runner ns3-nix-vector-routing)
target_link_libraries(test-runner ns3-olsr)
target_link_libraries(test-runner ns3-point-to-point)
target_link_libraries(test-runner ns3-point-to-point-layout)
target_link_libraries(test-runner ns3-propagation)
target_link_libraries(test-runner ns3-sixlowpan)
target_link_libraries(test-runner ns3-spectrum)
target_link_libraries(test-runner ns3-stats)
target_link_libraries(test-runner ns3-tap-bridge)
target_link_libraries(test-runner ns3-test)
target_link_libraries(test-runner ns3-topology-read)
target_link_libraries(test-runner ns3-traffic-control)
target_link_libraries(test-runner ns3-uan)
target_link_libraries(test-runner ns3-virtual-net-device)
target_link_libraries(test-runner ns3-wave)
target_link_libraries(test-runner ns3-wifi)
target_link_libraries(test-runner ns3-wimax)
set(bench-simulator_SOURCES
bench-simulator.cc)
set(bench-simulator_INCLUDES
#
#)
include_directories(${bench-simulator_INCLUDES})
add_executable(bench-simulator ${bench-simulator_SOURCES})
target_link_libraries(bench-simulator ns3-core)
set(bench-packets_SOURCES
bench-packets.cc)
set(bench-packets_INCLUDES
#
#)
include_directories(${bench-packets_INCLUDES})
add_executable(bench-packets ${bench-packets_SOURCES})
target_link_libraries(bench-packets ns3-network)
set(print-introspected-doxygen_SOURCES
print-introspected-doxygen.cc)
set(print-introspected-doxygen_INCLUDES
#
../build/ns3/ndnSIM/NFD
../ns3/ndnSIM/NFD
../build/src/ndnSIM/NFD/core
../src/ndnSIM/NFD/core
../build/src/ndnSIM/NFD/daemon
../src/ndnSIM/NFD/daemon
../build/src/ndnSIM/NFD/rib
../src/ndnSIM/NFD/rib
../build/ns3/ndnSIM
../ns3/ndnSIM
#
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/ns3/ndnSIM/NFD
/home/sunny/Documents/nwfq-ndnsim/ns-3/ns3/ndnSIM/NFD
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/core
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/core
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/daemon
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/daemon
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/src/ndnSIM/NFD/rib
/home/sunny/Documents/nwfq-ndnsim/ns-3/src/ndnSIM/NFD/rib
/home/sunny/Documents/nwfq-ndnsim/ns-3/build/ns3/ndnSIM
/home/sunny/Documents/nwfq-ndnsim/ns-3/ns3/ndnSIM
/usr/include
/usr/include)
include_directories(${print-introspected-doxygen_INCLUDES})
add_executable(print-introspected-doxygen ${print-introspected-doxygen_SOURCES})
target_link_libraries(print-introspected-doxygen ns3-antenna)
target_link_libraries(print-introspected-doxygen ns3-aodv)
target_link_libraries(print-introspected-doxygen ns3-applications)
target_link_libraries(print-introspected-doxygen ns3-bridge)
target_link_libraries(print-introspected-doxygen ns3-buildings)
target_link_libraries(print-introspected-doxygen ns3-config-store)
target_link_libraries(print-introspected-doxygen ns3-core)
target_link_libraries(print-introspected-doxygen ns3-csma)
target_link_libraries(print-introspected-doxygen ns3-csma-layout)
target_link_libraries(print-introspected-doxygen ns3-dsdv)
target_link_libraries(print-introspected-doxygen ns3-dsr)
target_link_libraries(print-introspected-doxygen ns3-energy)
target_link_libraries(print-introspected-doxygen ns3-fd-net-device)
target_link_libraries(print-introspected-doxygen ns3-flow-monitor)
target_link_libraries(print-introspected-doxygen ns3-internet)
target_link_libraries(print-introspected-doxygen ns3-internet-apps)
target_link_libraries(print-introspected-doxygen ns3-lr-wpan)
target_link_libraries(print-introspected-doxygen ns3-lte)
target_link_libraries(print-introspected-doxygen ns3-mesh)
target_link_libraries(print-introspected-doxygen ns3-mobility)
target_link_libraries(print-introspected-doxygen ns3-mpi)
target_link_libraries(print-introspected-doxygen ns3-ndnSIM)
target_link_libraries(print-introspected-doxygen ns3-netanim)
target_link_libraries(print-introspected-doxygen ns3-network)
target_link_libraries(print-introspected-doxygen ns3-nix-vector-routing)
target_link_libraries(print-introspected-doxygen ns3-olsr)
target_link_libraries(print-introspected-doxygen ns3-point-to-point)
target_link_libraries(print-introspected-doxygen ns3-point-to-point-layout)
target_link_libraries(print-introspected-doxygen ns3-propagation)
target_link_libraries(print-introspected-doxygen ns3-sixlowpan)
target_link_libraries(print-introspected-doxygen ns3-spectrum)
target_link_libraries(print-introspected-doxygen ns3-stats)
target_link_libraries(print-introspected-doxygen ns3-tap-bridge)
target_link_libraries(print-introspected-doxygen ns3-test)
target_link_libraries(print-introspected-doxygen ns3-topology-read)
target_link_libraries(print-introspected-doxygen ns3-traffic-control)
target_link_libraries(print-introspected-doxygen ns3-uan)
target_link_libraries(print-introspected-doxygen ns3-virtual-net-device)
target_link_libraries(print-introspected-doxygen ns3-wave)
target_link_libraries(print-introspected-doxygen ns3-wifi)
target_link_libraries(print-introspected-doxygen ns3-wimax)
+319
View File
@@ -0,0 +1,319 @@
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
# Michel Mooij, michel.mooij7@gmail.com
'''
Summary
-------
Generate *cmake* files of all C/C++ programs, static- and shared libraries
that have been defined within a *waf* build environment.
Once exported to *cmake*, all exported (C/C++) tasks can be build without
any further need for, or dependency, to the *waf* build system itself.
**cmake** is an open source cross-platform build system designed to build, test
and package software. It is available for all major Desktop Operating Systems
(MS Windows, all major Linux distributions and Macintosh OS-X).
See http://www.cmake.org for a more detailed description on how to install
and use it for your particular Desktop environment.
Description
-----------
When exporting *waf* project data, a single top level **CMakeLists.txt** file
will be exported in the top level directory of your *waf* build environment.
This *cmake* build file will contain references to all exported *cmake*
build files of each individual C/C++ build task. It will also contain generic
variables and settings (e.g compiler to use, global preprocessor defines, link
options and so on).
Example below presents an overview of an environment in which *cmake*
build files already have been exported::
.
├── components
│ └── clib
│ ├── program
│ │ ├── CMakeLists.txt
│ │ └── wscript
│ ├── shared
│ │ ├── CMakeLists.txt
│ │ └── wscript
│ └── static
│ ├── CMakeLists.txt
│ └── wscript
│
├── CMakeLists.txt
└── wscript
Usage
-----
Tasks can be exported to *cmake* using the command, as shown in the
example below::
$ waf cmake
All exported *cmake* build files can be removed in 'one go' using the *cmake*
*cleanup* option::
$ waf cmake --cmake-clean
Tasks generators to be excluded can be marked with the *skipme* option
as shown below::
def build(bld):
bld.program(name='foo', src='foobar.c', cmake_skip=True)
'''
from waflib.Build import BuildContext
from waflib import Utils, Logs, Context
import waftools
from waftools import deps
def options(opt):
'''Adds command line options for the CMake *waftool*.
:param opt: Options context from the *waf* build environment.
:type opt: waflib.Options.OptionsContext
'''
opt.add_option('--cmake', dest='cmake', default=False, action='store_true',
help='select cmake for export/import actions')
opt.add_option('--clean', dest='clean', default=False, action='store_true', help='delete exported files')
def configure(conf):
'''Method that will be invoked by *waf* when configuring the build
environment.
:param conf: Configuration context from the *waf* build environment.
:type conf: waflib.Configure.ConfigurationContext
'''
conf.find_program('cmake', var='CMAKE', mandatory=False)
class CMakeContext(BuildContext):
'''export C/C++ tasks to CMake.'''
cmd = 'cmake'
def execute(self):
'''Will be invoked when issuing the *cmake* command.'''
self.restore()
if not self.all_envs:
self.load_envs()
self.recurse([self.run_dir])
self.pre_build()
for group in self.groups:
for tgen in group:
try:
f = tgen.post
except AttributeError:
pass
else:
f()
try:
self.get_tgen_by_name('')
except Exception:
pass
self.cmake = True
if self.options.clean:
cleanup(self)
else:
export(self)
self.timer = Utils.Timer()
def export(bld):
'''Exports all C and C++ task generators to cmake.
:param bld: a *waf* build instance from the top level *wscript*.
:type bld: waflib.Build.BuildContext
'''
if not bld.options.cmake and not hasattr(bld, 'cmake'):
return
cmakes = {}
loc = bld.path.relpath().replace('\\', '/')
top = CMake(bld, loc)
cmakes[loc] = top
targets = waftools.deps.get_targets(bld)
for tgen in bld.task_gen_cache_names.values():
if targets and tgen.get_name() not in targets:
continue
if getattr(tgen, 'cmake_skipme', False):
continue
if set(('c', 'cxx')) & set(getattr(tgen, 'features', [])):
loc = tgen.path.relpath().replace('\\', '/')
if loc not in cmakes:
cmake = CMake(bld, loc)
cmakes[loc] = cmake
top.add_child(cmake)
cmakes[loc].add_tgen(tgen)
for cmake in cmakes.values():
cmake.export()
def cleanup(bld):
'''Removes all generated makefiles from the *waf* build environment.
:param bld: a *waf* build instance from the top level *wscript*.
:type bld: waflib.Build.BuildContext
'''
if not bld.options.clean:
return
loc = bld.path.relpath().replace('\\', '/')
CMake(bld, loc).cleanup()
targets = waftools.deps.get_targets(bld)
for tgen in bld.task_gen_cache_names.values():
if targets and tgen.get_name() not in targets:
continue
if getattr(tgen, 'cmake_skipme', False):
continue
if set(('c', 'cxx')) & set(getattr(tgen, 'features', [])):
loc = tgen.path.relpath().replace('\\', '/')
CMake(bld, loc).cleanup()
class CMake(object):
def __init__(self, bld, location):
self.bld = bld
self.location = location
self.cmakes = []
self.tgens = []
def export(self):
content = self.get_content()
if not content:
return
node = self.make_node()
if not node:
return
node.write(content)
Logs.pprint('YELLOW', 'exported: %s' % node.abspath())
def cleanup(self):
node = self.find_node()
if node:
node.delete()
Logs.pprint('YELLOW', 'removed: %s' % node.abspath())
def add_child(self, cmake):
self.cmakes.append(cmake)
def add_tgen(self, tgen):
self.tgens.append(tgen)
def get_location(self):
return self.location
def get_fname(self):
name = '%s/CMakeLists.txt' % (self.location)
return name
def find_node(self):
name = self.get_fname()
if not name:
return None
return self.bld.srcnode.find_node(name)
def make_node(self):
name = self.get_fname()
if not name:
return None
return self.bld.srcnode.make_node(name)
def get_content(self):
is_top = (self.location == self.bld.path.relpath())
content = ''
if is_top:
content += 'cmake_minimum_required (VERSION 2.6)\n'
content += 'project (%s)\n' % (getattr(Context.g_module, Context.APPNAME))
content += '\n'
env = self.bld.env
defines = env.DEFINES
if len(defines):
content += 'add_definitions(-D%s)\n' % (' -D'.join(defines))
content += '\n'
flags = env.CFLAGS
if len(flags):
content += 'set(CMAKE_C_FLAGS "%s")\n' % (' '.join(flags))
flags = env.CXXFLAGS
if len(flags):
content += 'set(CMAKE_CXX_FLAGS "%s")\n' % (' '.join(flags))
if len(self.tgens):
content += '\n'
for tgen in self.tgens:
content += self.get_tgen_content(tgen)
if len(self.cmakes):
content += '\n'
for cmake in self.cmakes:
content += 'add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/%s)\n' % (cmake.get_location())
return content
def get_tgen_content(self, tgen):
content = ''
name = tgen.get_name()
content += 'set(%s_SOURCES' % (name)
for src in tgen.source:
content += '\n %s' % (src.path_from(tgen.path).replace('\\', '/'))
content += ')\n\n'
includes = self.get_genlist(tgen, 'includes')
includes.extend(tgen.env.INCLUDES)
if len(includes):
content += 'set(%s_INCLUDES' % (name)
for include in includes:
content += '\n %s' % include
content += ')\n\n'
content += 'include_directories(${%s_INCLUDES})\n' % (name)
content += '\n'
defines = self.get_genlist(tgen, 'defines')
if len(defines):
content += 'add_definitions(-D%s)\n' % (' -D'.join(defines))
content += '\n'
if set(('cprogram', 'cxxprogram')) & set(tgen.features):
content += 'add_executable(%s ${%s_SOURCES})\n' % (name, name)
elif set(('cshlib', 'cxxshlib')) & set(tgen.features):
content += 'add_library(%s SHARED ${%s_SOURCES})\n' % (name, name)
else: # cstlib, cxxstlib or objects
content += 'add_library(%s ${%s_SOURCES})\n' % (name, name)
_use = getattr(tgen, 'use', [])
if not isinstance(_use, list):
_use = _use.split(" ")
_lib = getattr(tgen, 'lib', [])
if not isinstance(_lib, list):
_lib = _lib.split(" ")
libs = _use + _lib
if len(libs):
content += '\n'
for lib in libs:
content += 'target_link_libraries(%s %s)\n' % (name, lib)
content += '\n'
return content
def get_genlist(self, tgen, name):
lst = Utils.to_list(getattr(tgen, name, []))
lst = [str(l.path_from(tgen.path)) if hasattr(l, 'path_from') else l for l in lst]
return [l.replace('\\', '/') for l in lst]
+2
View File
@@ -143,6 +143,7 @@ def options(opt):
opt.load('compiler_cxx')
opt.load('cflags')
opt.load('gnu_dirs')
opt.load('cmake', tooldir=['waf-tools'])
opt.add_option('--check-config',
help=('Print the current configuration.'),
@@ -363,6 +364,7 @@ def configure(conf):
conf.load('compiler_cxx')
conf.load('cflags', tooldir=['waf-tools'])
conf.load('command', tooldir=['waf-tools'])
#conf.load('camke', tooldir=['waf-tools'])
conf.load('gnu_dirs')
conf.load('clang_compilation_database', tooldir=['waf-tools'])
+4523 -4575
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -69,7 +69,7 @@ main(int argc, char* argv[])
Simulator::Stop(Seconds(20.0));
ndn::L3RateTracer::InstallAll("rate-trace.txt", Seconds(0.5));
ndn::L3RateTracer::InstallAll("rate-trace.txt", Seconds(0.1));
Simulator::Run();
Simulator::Destroy();
+86
View File
@@ -0,0 +1,86 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo-6-node.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> consumer1 = Names::Find<Node>("Src1");
Ptr<Node> consumer2 = Names::Find<Node>("Src2");
Ptr<Node> producer1 = Names::Find<Node>("Dst1");
Ptr<Node> producer2 = Names::Find<Node>("Dst2");
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerNWFQ");
ndn::AppHelper consumerHelper2("ns3::ndn::ConsumerCbr");
consumerHelper2.SetAttribute("Frequency", StringValue("500")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
consumerHelper2.SetPrefix("/dst1");
consumerHelper2.Install(consumer1);
// on the second consumer node install a Consumer application
// that will express interests in /dst2 namespace
consumerHelper.SetPrefix("/dst2");
//consumerHelper.SetAttribute("Frequency", StringValue("500")); // 100 interests a second
consumerHelper.Install(consumer2);
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
ndnGlobalRoutingHelper.AddOrigins("/dst1", producer1);
producerHelper.SetPrefix("/dst1");
producerHelper.Install(producer1);
// Register /dst2 prefix with global routing controller and
// install producer that will satisfy Interests in /dst2 namespace
ndnGlobalRoutingHelper.AddOrigins("/dst2", producer2);
producerHelper.SetPrefix("/dst2");
producerHelper.Install(producer2);
// Calculate and install FIBs
ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(20.0));
ndn::L3RateTracer::InstallAll("rate-trace.txt", Seconds(0.5));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}