Comments (8)
Don't spawn thread in Click. Use a Click thread by assigning some element with StaticThreadSched.
It seems what you want to do is to change the configuration of UDPIP6ENCAP every second. I would suggest making a script element like that :
s :: Script( TYPE ACTIVE,
label loop,
wait 1s,
set ip udpencap.saddr,
write udpencap.saddr $(add $ip 1),
goto loop);
StaticThreadSched(s 2);
Assuming the element has an saddr read/write handler. Maybe easier, just create a handler named "inc_saddr" that will add 1 to the IP address. I'm not sure of the behavior of the code above because of endianess. Then you can call "write udpencap.inc_saddr" to simply call the handler.
Tom
from fastclick.
Thanks for the response Tom.
It seems what you want to do is to change the configuration of UDPIP6ENCAP every second
It will be less than a second. If 1000 unique flows per second is requested, the config needs to change every milisecond. The change has to happen at microseconds if more than 1000 unique flows are requested.
The Script element wiki states that the wait argument has microseconds precision, but can it accept 0.001s or less?
Maybe easier, just create a handler named "inc_saddr" that will add 1 to the IP address
Yep, I will follow this approach if the Script element can wait for mili or microseconds.
from fastclick.
Milli yes, micro no. But you may create a "cron" element that is more efficient at poking some handler
from fastclick.
It might just be quicker/easier to extend UDPIP6Encap. Just use a Click timer to increment the address. Or if very high fps rate is required, use a tokenbucket with Click Task, see RatedSource or similar element on how to implement this.
from fastclick.
True, but I don't like elements being extended/duplicated for every feature. I think if "it" can be done with a combination of element, it's the best path.
from fastclick.
Thanks for the input guys!
from fastclick.
So here is how the code looks like
/------------Declarations-----------
//+++++DPDK0 Interface(Inside)+++++
DPDK0_OUT :: ToDPDKDevice(0);
//+++++DPDK1 Interface(Outside)+++++
DPDK1_IN :: FromDPDKDevice(1, PROMISC true);
udpEncap :: UDPIP6Encap(2001:2001:2001:2001::1, 1234, 64:ff9b::192.168.2.5, 1234)
//--------Program Start----------
InfiniteSource(LENGTH 64, LIMIT 1500000, STOP true)
-> NumberPacket(OFFSET 0)
-> udpEncap
-> EtherEncap(0x86DD, 00:04:23:D0:93:63, 00:17:cb:0d:f8:db)
-> record :: RecordTimestamp()
-> DPDK0_OUT;
s :: Script( TYPE ACTIVE,
label loop,
wait 1s,
set ip udpEncap.src,
write udpEncap.src $(add $ip 1),
goto loop );
StaticThreadSched(s 2);
DPDK1_IN
-> CheckNumberPacket(OFFSET 62, COUNT 1500000)
-> diff :: TimestampDiff(OFFSET 62, RECORDER record)
-> counter :: AverageCounter()
-> Discard;
//--------Program End----------
DriverManager(wait,read diff.average, read counter.count, read counter.rate)
I get the following warning
While executing 's :: Script':
expected list of numbers
I guess add is not liking an IPv6 address as an int as it is 16 bytes?
from fastclick.
Maybe easier, just create a handler named "inc_saddr" that will add 1 to the IP address.
Ended up following this advice and it works. Thanks!
from fastclick.
Related Issues (20)
- Create Element HOT 2
- Secondary DPDK with FastClick HOT 2
- Access useful_kcycles() HOT 3
- Input aggregation element HOT 1
- --with-netmap does not compile HOT 3
- FastClick can't identify DPDK PORT,whatever Integer or PCI address.
- port 0 Rx queue allocation failed: Cannot allocate memory HOT 7
- Illegal instruction (core dumped) when using ToDPDKDevice() HOT 3
- rte_mempool segmentation fault. HOT 8
- storeing data in packet HOT 2
- How to enable scattered mode in fastclick? HOT 7
- issue in make package element HOT 3
- How to use replayUnqueue or MultiReplayUnqueue to limit the tx rate? HOT 3
- Automatically update wiki doc with CI
- middleclick configuration HOT 1
- compile error about context HOT 1
- Allow loop in FromDump HOT 4
- Non-existent librairies when parsing llvm-config's output
- FromDPDKDevice(FLOW_RULES_FILE) only work with DPDK<=21.11 HOT 2
- About address of IIO LLC WAYS in Ice lake HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastclick.