tylertreat / comcast

Simulating shitty network connections so you can build better systems.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MacOSX Support

opened this issue · comments

I've come to the conclusion that PF does not include the features necessary to do the likes of arbitrary packet drop/reorder/corruption or delay. I can get working at the very least a bandwidth limit, and some packet drop may possible ensue from that by way of using a priority queue (PRIQ) setup where lower priority queues may lose packets if the data to the highest priority queue is saturated. But there's no way to finely control this behavior through means of configuration in similar fashion to TC and IPFW. So PF will only have very basic support for our purposes, thus leaving MacOSX 10.10.x poorly supported by the scope of this project.

Hi

Thanks for the clarification.

What would exactly be needed to be done to at least enable bandwidth limitation and packet loss probability?

How could one contribute to this? I have been working with TC before but I find it hard to find documentation on how to achieve even bandwidth control using PF. If you could provide some info here, I'd be happy to start a pull request.

Yeah, tbh I haven't spent the time looking through how PF works, and I probably won't be getting to it anytime soon. If anyone has any insight on this that would be awesome.

The probability loss/corruption is not possible with PF. It just doesn't have the feature. It's not a lacking of documentation (like how TC is). It's a lack of implementation. The only thing that is available is bandwidth limiting. I haven't had time to tinker with this much but here's what I have so far.

PF support will be an exercise in reading/parsing/writing lines in a configuration file:

altq on <interface here> cbq bandwidth 100% queue { fast_lane, slow_lane }

oldqueue fast_lane bandwidth <bandwidth> priority 1 cbq(default borrow)
oldqueue slow_lane bandwidth <bandwidth> priority 2 cbq(borrow)

slow_nets = "{ <specified ip/cidr>, <specified ip/cidr> }"
fast_nets = "{ <specified ip/cidr>. <specified ip/cidr> }"

pass in on <interface here> proto {tcp, udp} from slow_nets to any queue slow_lane
pass in on <interface here> proto {tcp, udp} from fast_nets to any queue fast_lane

Addressed in #35