jsommers / fs

The fs flow record generator / network simulator.
GNU General Public License v2.0
21 stars 10 forks source link

Question about the counters #2

Closed ederlf closed 6 years ago

ederlf commented 6 years ago

I noticed something interesting about the counters when playing with fs-sdn when executing that simpler version of openflow_small_cbr.dot.

It uses the learning switch application and sends traffic from switch A that goes through B and ends in C. Every interfaces can forward 10Mpbs. The udp traffic starts at 5s and an additional flow of 10Mb is sent every second.

The interesting thing is that in the A counters I can see the flows leaving every seconds, but the first flow only reaches B at 7s and C at 8s. In a scenario without congestion and no queue delay, or competing flows, at 10Mbps, the time to reach should not be near 6s? (Approximately the time it takes to be transmitted to switch A, considering that the next switch starts to transmit as soon as the first packet reaches it).

A counters 5.000 simple->a 1250000 bytes 826 pkts 1 flows 7.000 simple->a 1250000 bytes 826 pkts 1 flows 8.000 simple->a 1250000 bytes 826 pkts 1 flows

B counters 7.000 a->b 1250000 bytes 826 pkts 1 flows 9.000 a->b 1250000 bytes 826 pkts 1 flows

C counters 8.000 b->c 1250000 bytes 826 pkts 1 flows 10.000 b->c 1250000 bytes 826 pkts 1 flows

Looking in the code

wait = self.delay + flowlet.size / self.capacity

The waiting time is calculated that way, which means for the flow size sent, the wait is going to be 1s, which explains the difference in the interval between different switches. Is it a known problem or is it related to the way traffic is being generated? (Considering the importance of the traffic generator to it).

jsommers commented 6 years ago

From what I can tell this is expected behavior. Since fs has no notion of a packet, it simply marks the time at which the whole flowlet ("clump of packets") has arrived. Also, since the counters are gathered at regular discrete intervals, if the end of a flowlet arrives just after time t (i.e., the wait time extends to some time t+delta) then the counters dumped at time t won't show any of the flowlet, even though in a packet-oriented simulator some (or many) of the packets would have arrived.

ederlf commented 6 years ago

Thanks for the answer. I quite like your concept of flowlet and I would like to use it for the traffic model of a simulator I am building. So I want to get it right.

I understand the point where flows arrive in a switch before updating the counters, but it seems too much that one flowlet containing 10Mb, passing through 3 switches that can push 10Mbps will take 3 seconds to arrive at the destination. (I believe it should be slightly more than 1s, considering that a switch would no wait a whole flow to complete before transmitting it ). Wondering if there is something I am missing? (please, pardon my ignorance if I am insisting in a stupid point).

EDIT: Now I realize that there is no way to calculate it more accurately without the size of each packet. The way it works in relation to the flow completion time is similar to what would happen without segmentation. I need to think in a way to be able to calculate it differently. Closing the issue for now.