OPNsense Forum

Archive => 23.1 Legacy Series => Topic started by: spacecase-25 on August 14, 2023, 01:35:26 AM

Title: Trouble figuring out traffic shaping: prioritize all traffic to specific IP
Post by: spacecase-25 on August 14, 2023, 01:35:26 AM
I feel like this should be a fairly simple task, but I am having a hell of a time figuring out how to do it.  Quite simply, I want to prioritize all traffic to and from 192.188.0.8 above all other traffic on the network, regardless of protocol or ports.  I want this to be as close to real time routing as possible.  On a consumer router I would have just selected the device as higher priority in the QoS settings, but opnsense is clearly more powerful and granular... however, it's to the point where I have no idea how to use it.  The documentation hasn't been too much assistance either.  I don't really want to limit bandwidth to other clients... just want to have traffic to this one client weighted higher than others. 

The client is a network streamer for my stereo, and I've tried messing with pipes and queues but I'm still experiencing dropouts in streaming audio.  Never had dropouts with my old TP-Link router, and if a cheapo consumer router can do it, surely an enterprise grade system (enterprise software, at least) should be able to handle it without issue. 

Thanks & please excuse my absolutely n00b question.

Traffic works in 2 basic ways... either streaming files stored on 192.188.0.2 via UPNP or streaming music via WAN from Qobuz (online music streaming service).  I get dropouts from both, and there's plenty of bandwidth on my local network that this should never be an issue, which is why I'm convinced it's an issue of prioritizing packets.
Title: Re: Trouble figuring out traffic shaping: prioritize all traffic to specific IP
Post by: Seimus on August 14, 2023, 09:40:33 AM
Before we touch the Question about the Shaper/Shaping. You are saying even if you are streaming media via your LAN you are having drops?

How is your Network designed?
What is your OPN HW?
What is your Internet connection BW?
What is your LAN BW?
Go to this page https://www.dslreports.com/speedtest and run the test, what are the results?
Also please do ping tests between your Host 192.188.0.8 > 192.188.0.2 And 192.188.0.8 to > 1.1.1.1


In regards of the Shaper, there are plenty guides how to do it, mostly the guides even found on this forum work with FQ_CODEL SQM/AQM Shaper that will is implement to Shape WAN in order to prevent buffer bloat. Usually just turning the function, setting ECM and fine tune 2 parameters should be enough of get a A+ ranked performance over WAN. Usually its done in very simple way > 2 Ques, 2 Pipes > 2 Rules, one for download one for upload. In a specific case you need to give more BW to a specific client or APP you can to a more granular segregation and set the Weight Parameter.

However per your description, this doesn't look to be a congestion/saturation problem.

Regards,
S.
Title: Re: Trouble figuring out traffic shaping: prioritize all traffic to specific IP
Post by: spacecase-25 on August 14, 2023, 03:26:00 PM
I'll answer what I can from where I am right now

Network starts with a Comcast cable router in gateway mode (only provides public IP) > opnsense router > my previous TPLink router set up as an AP (also serving as the main switch).

Plugged into the switch is my file server and the MoCA 2 adapter which runs the connection to my living room, from there it goes to another switch that the streamer & media PC is plugged into.

MoCA adapter provides 700mbit/s so that should be plenty of bandwidth.

At this point my plan is to put another gigabit switch between the router and AP, perhaps the TP Link is just not up to the task.

I have 7 devices connected to the network, but not all are ever really being used at the same time.
Title: Re: Trouble figuring out traffic shaping: prioritize all traffic to specific IP
Post by: spacecase-25 on August 14, 2023, 03:27:54 PM
Kikusenko Firewall Micro Appliance, Mini PC Celeron J4125 Quad Core, 4 lntel i226-V 2.5G Nics Ports, AES-NI, Barebone, Soft Router, VPN, 8GB RAM 128GB SSD https://a.co/d/73zJ3Oj
Title: Re: Trouble figuring out traffic shaping: prioritize all traffic to specific IP
Post by: spacecase-25 on August 15, 2023, 01:17:29 AM
Quote from: Seimus on August 14, 2023, 09:40:33 AM
Before we touch the Question about the Shaper/Shaping. You are saying even if you are streaming media via your LAN you are having drops?

How is your Network designed?
What is your OPN HW?
What is your Internet connection BW?
What is your LAN BW?
Go to this page https://www.dslreports.com/speedtest and run the test, what are the results?
Also please do ping tests between your Host 192.188.0.8 > 192.188.0.2 And 192.188.0.8 to > 1.1.1.1


In regards of the Shaper, there are plenty guides how to do it, mostly the guides even found on this forum work with FQ_CODEL SQM/AQM Shaper that will is implement to Shape WAN in order to prevent buffer bloat. Usually just turning the function, setting ECM and fine tune 2 parameters should be enough of get a A+ ranked performance over WAN. Usually its done in very simple way > 2 Ques, 2 Pipes > 2 Rules, one for download one for upload. In a specific case you need to give more BW to a specific client or APP you can to a more granular segregation and set the Weight Parameter.

However per your description, this doesn't look to be a congestion/saturation problem.

Regards,
S.
What's so special about this test?  I cannot get it to run, even without unbound or any adblocking extensions enabled.
Title: Re: Trouble figuring out traffic shaping: prioritize all traffic to specific IP
Post by: Seimus on August 15, 2023, 01:04:54 PM
Quote from: spacecase-25 on August 14, 2023, 03:26:00 PM
I'll answer what I can from where I am right now

Network starts with a Comcast cable router in gateway mode (only provides public IP) > opnsense router > my previous TPLink router set up as an AP (also serving as the main switch).

Plugged into the switch is my file server and the MoCA 2 adapter which runs the connection to my living room, from there it goes to another switch that the streamer & media PC is plugged into.

MoCA adapter provides 700mbit/s so that should be plenty of bandwidth.

At this point my plan is to put another gigabit switch between the router and AP, perhaps the TP Link is just not up to the task.

I have 7 devices connected to the network, but not all are ever really being used at the same time.

Alright this is a bit kinky, I would not personally use an AllinOneRouter as the main switch. It can definitely cause its own share of problems.

What kind of Router is this?
Are you using the Stock TPlink Firmware or OpenWRT?

Quote from: spacecase-25 on August 14, 2023, 03:27:54 PM
Kikusenko Firewall Micro Appliance, Mini PC Celeron J4125 Quad Core, 4 lntel i226-V 2.5G Nics Ports, AES-NI, Barebone, Soft Router, VPN, 8GB RAM 128GB SSD https://a.co/d/73zJ3Oj

Solid Hardware, so you should have enough resources to route at 1G with several features turned on. I dont believe personally that you would have problems even on InterVLAN communications with this H/W.

Quote from: spacecase-25 on August 15, 2023, 01:17:29 AM
What's so special about this test?  I cannot get it to run, even without unbound or any adblocking extensions enabled.

This test will test buffer bloat, it will show if you hit a buffer bloat situation on your WAN. If the link is not working try the http variant they have > http://www.dslreports.com/speedtest
Keep in mind this tests only WAN buffer bloat, however you have issues as well on the LAN side so IntraVLAN. This really could point that the issue could be on the TPlink Router you are using as a SWITCH as that device is a common nominator fore LAN as well WAN.

Basicaly to the concept of InterVLAN and IntraVLAN >
InterVLAN  > routing between 2 different networks, usually VLANs in our HomeLab or from GW to provider
IntraVLAN  > switching within same VLAN segment.


Correct me if I am wrong but your server, and your host to which you are streaming the media are in the same Subnet correct? That would mean you are using only IntraVLAN, if you are doing IntraVLAN L3 is not engaged, the traffic stays as Frames on L2 and are not passed to the L3 GW, because devices in the same VLAN/subnet are able to resolve the MAC address of the destination IP, thus the switches are able to forward the traffic direct between hosts.

If we take this into account meaning traffic stays only in L2 thus only on Switches level, this points to be a possible switch related problem


Regards,
S.