Shaping Linux Traffic with tc

Поділитися
Вставка
  • Опубліковано 4 лип 2024
  • In this video we'll explore using tc (traffic control) to shape traffic in a Linux. This can enable you to do things like simulating limited bandwidth to implementing robust quality of service solutions.
    blog post: octetz.com/docs/2020/2020-09-...
    00:00:00 - Quality of Service
    00:05:07 - Traffic Control
    00:15:17 - Implementing Shaping
  • Наука та технологія

КОМЕНТАРІ • 67

  • @mikinio303
    @mikinio303 3 роки тому +20

    Your videos are incredibly good, please don't stop making them

  • @peterg91
    @peterg91 9 місяців тому +1

    Excellent demo even in 2023!! Much appreciated to give a sense to few of cornerstones of otherwise heavy-looking manual content

  • @PetrasL_1976
    @PetrasL_1976 2 роки тому

    Really this is the best introduction to TC i have ever seen! Thanks.

  • @al-du6lb
    @al-du6lb 2 роки тому +4

    Dude, you definitely have a talent for teaching.

  • @sylvainrocca-serra3402
    @sylvainrocca-serra3402 2 роки тому +2

    TC is incredible, I did not knew that tool and the stuff you can do with it is amazing, gotta look into it ! Great Video keep up the good work !

  • @lukezhang3715
    @lukezhang3715 Рік тому +1

    Can't believe I watched it from beginning to the end! Great video man, thanks for making this.

  • @alijavidi2503
    @alijavidi2503 6 місяців тому +1

    This is such a high quality video that I couldn't resist my urge to subscribe! You're great at explaining stuff, Keep it going

  • @RiseAgainst004
    @RiseAgainst004 2 роки тому +4

    amazing stuff, thank you very much for that informative video and sharing the script with us.
    was looking for a solution for weeks now and yours did the job perfect!
    You definitely have a talent for teaching.

    • @peterg91
      @peterg91 9 місяців тому

      agree here

  • @jeanchristophe5976
    @jeanchristophe5976 2 роки тому

    great video, best introduction to tc I’ve ever read.

  • @giancarloboaron7266
    @giancarloboaron7266 3 роки тому +1

    What a great video! Thanks for sharing you knowledge!

  • @ZeroMan1986
    @ZeroMan1986 2 роки тому

    Thank you for the great video. I understanding tc much better than before. Many thanks

  • @tomschuring
    @tomschuring Рік тому

    best description i've found on tc.. thank you !

  • @creponnekarim2865
    @creponnekarim2865 2 роки тому

    this video was amazing
    it really demystified the whole scary tc command for me
    thanks man !

  • @ramseshernandez3725
    @ramseshernandez3725 11 місяців тому

    I was searching the way to simulate limited bandwith to make a proof of concept network with protocols HTTP and MQ, and I found your video ; great video ...

  • @rafaelcampoverde
    @rafaelcampoverde 2 роки тому

    I wait for this for so long.. thank you!!!!

  • @furkanturkal8414
    @furkanturkal8414 Рік тому

    Such an awesome video! Keep this great work!

  • @jiezheng9454
    @jiezheng9454 9 місяців тому

    This is sooooo good! Thank you so much! Please keep making these videos!

  • @curtisscholl569
    @curtisscholl569 2 роки тому

    Excellent. This gives me a basis to learn from! Thanks

  • @murat_sezgin
    @murat_sezgin 3 роки тому

    With one word, this is “awesome”.

  • @kaikun26
    @kaikun26 7 місяців тому

    You saved by Bachelor's thesis one week before the deadline. Thank you so much

  • @leandrormor
    @leandrormor 2 роки тому +1

    thanks, your explanation is fantastic =] , I'm going to watch more of your videos later this week (and recommend)!!!

  • @BJHzlz
    @BJHzlz 3 роки тому

    Pretty awesome, Thanks for sharing this cool stuff.!!!!👍

  • @pot8778
    @pot8778 2 роки тому

    Good job, I like your way of teaching:)

  • @isaacc2887
    @isaacc2887 5 місяців тому

    High quality video, still a great resource in 2024

  • @kalimuthu6831
    @kalimuthu6831 2 роки тому

    it's awesome! Please keep doing it

  • @JoschiKraxner
    @JoschiKraxner 3 роки тому

    Really awesome. You should definitely upload more videos

  • @nayanghosh7100
    @nayanghosh7100 2 роки тому

    very good explanation .

  • @nayanghosh7100
    @nayanghosh7100 2 роки тому

    thank u for this great video.

  • @SahanaJoshi1729
    @SahanaJoshi1729 Рік тому

    Very helpful, thank you for this video! :)

  • @JitenPalaparthi
    @JitenPalaparthi 2 роки тому

    8:46 genius stuff. Happy that I worked with you for some time :)

    • @joshrosso
      @joshrosso  2 роки тому

      Hey Jiten! Nice to hear from you and thanks :)

  • @swapu1224
    @swapu1224 2 роки тому

    Nice explanation.. Thank You..

  • @sumanthkaushik3898
    @sumanthkaushik3898 2 роки тому

    Great tutorial! Thanks

  • @michaelwong6004
    @michaelwong6004 3 роки тому

    very informative! thank you!

  • @mokhtarbelkhiati7703
    @mokhtarbelkhiati7703 3 роки тому

    thank you , this video gives a big help to me .

  • @Diamond-rs1jz
    @Diamond-rs1jz Рік тому

    that's probably most interesting video about qos i've ever seen.

    • @joshrosso
      @joshrosso  Рік тому +1

      Really rad to hear, thank you!

  • @antl31
    @antl31 2 роки тому

    great video, thanks!

  • @lakshminarasimmanv
    @lakshminarasimmanv 3 роки тому

    Please keep uploading more videos. Keep it up.

  • @pearlboy
    @pearlboy 3 роки тому

    Man you nailed it...

  • @xycainoff
    @xycainoff 6 місяців тому

    it's awesome!

  • @PauloMerson
    @PauloMerson 11 місяців тому +2

    Excellent explanation with design diagrams! 👏👏👏Do you have a video or blog post explaining the use of `tc` for adding jitter and packet loss?

  • @sowmyaparvati6220
    @sowmyaparvati6220 3 роки тому

    This is awesome. Please make a video on how to transfer incoming packets on one interface (ent0)to another interface (ent1) using tc command

  • @rebelScience
    @rebelScience 3 роки тому +1

    Awesome video. Never worked with TC. How can I add packet loss to the script you showed in the video? I tried a bunch of variants but can't get it to work.

  • @nithishkgnani
    @nithishkgnani 3 роки тому +1

    Thanks for this detailed and yet well explained video. My interface is named "enp0s3" and changed it in the script as required. But when i run it, I get the error "Cannot find device "enp0s3" ".
    I am able to send traffic via iperf. So the listening and transmission works well. What could be the reason for the cannot find device error ?

  • @ApexFPS
    @ApexFPS 3 роки тому +1

    More videos please please please!!!!

  • @fusca14tube
    @fusca14tube 3 роки тому

    Awesome! Very neat! Is there a way to activate this traffic control on specifics ports? Thanks.

  • @pist0448
    @pist0448 Місяць тому

    Firstly, thanks for the video, really informative!
    Could you please suggest how to extend the first simple bandwidth shaping example by adding some network latency (e.g. 60 ms) at the same time?

  • @shaunnichols4664
    @shaunnichols4664 Місяць тому

    wow, simple

  • @jesseglennthiam6752
    @jesseglennthiam6752 2 роки тому

    Hi is there some sort of instead putting ip address on dst_cidr, can we put on tls-host/server name as dest address?

  • @Haranoi17channel
    @Haranoi17channel 3 роки тому

    I have a question. How to attach two network adapters a wifi card and ethernet port to one class in order to be shaped as singular device?
    Basically I want them both share one bandwidth for download speed with one qdisc which is cake in order to remove ping spikes.

    • @bqwood
      @bqwood 3 роки тому

      Try reading this. It's old, but good:
      lartc.org/lartc.pdf

  • @achajackson5898
    @achajackson5898 7 місяців тому

    the dst cidr is for a particular server machine, Is it possible to limit for a particular application on that server ? I dont want to limit the entire server traffic. I want a particular app, it that possible ?

  • @jeep2liberty
    @jeep2liberty 2 роки тому +1

    I set this up on a home network. It actually restricted speed (egress) to a target NOT named as CIDR1 or CIDR2. I found that I removed the "default 30" from this line in the script:
    $TC qdisc add dev $IF root handle 1: htb #default 30 removed
    After this, the non CIDR host speed test (via iperf3) had the expected unrestricted bandwidth results. So I then tried to find documentation on HTB and what "Default 30" was supposed to mean.
    Anyone have a clue where to find the answer?
    Great video and thanks for sharing. It was never detailed as mentioned in the vid what "default 30" meant. (I still learned a bunch ! :-) Thanks)
    Edit.... I found that 'default' in HTB assigns all traffic not defined (filtered) to a flowid (30 in this case). Hope this helps someone, somewhere, sometime...

  •  Рік тому

    hello could you send example for simulate slow speed like GPRS or dialup and correct latency settings with tc because, i try it, but not working on inbound traffic just outbound, i need to working both inbound and outbound.

    • @joshrosso
      @joshrosso  Рік тому

      👋, I won't be able to create an example. But I'm hoping you're able to figure it out!

  • @ksv6ksv
    @ksv6ksv 3 роки тому

    Hi Octetz
    Nice videos
    I need some clarifications ,
    in this example , you are adding qdisc first
    tc qdisc add dev eth0 root handle 1:0
    then you are creating the class , and then filter.
    Can we add filter to the existing qdisc or always we need to create new qdisc and then attach filter to it ,
    in my case , in my system,
    i just listed the qdiscs , it was showing something like below
    tc qdiscs show
    qdisc mq 0: dev eth0 root
    qdisc pfifo_fast 0: dev eth0 parent :1 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
    If i want to add a filter which qdisc i should select (there are 2 qdiscs available above),
    i want to add filters to exclude some of the ports , what should be the filter commands ?
    Can you please help me on this ?

  • @al-du6lb
    @al-du6lb 2 роки тому

    so what you're saying is that it's basically the nice command, but for the network?

  • @hakanvansbro
    @hakanvansbro 3 роки тому

    Hi, thanx for a good video. I've been looking for a (c++) api to control tc from my own application, but not found any good hits. Anyone with a good hint? The use case is that I dynamically want to limit bandwidth for e.g. ftp on port 21 based on criteria not possible to detect in the network traffic itself.

    • @TimFromROC
      @TimFromROC 2 роки тому +1

      netlink socket - see iproute2 source code (tc folder)

  • @zulowski
    @zulowski 2 роки тому

    This won't work on Arch Linux, we're lacking a kernel module "netem" (network emulation)

  • @blisshop
    @blisshop 2 роки тому

    Great but it's just egrees. What about ingress?

  • @pearlboy
    @pearlboy 3 роки тому

    Dear Josh
    This is amazing tutorial, I need your help in addressing why am I not able to limit upload, only download gets limited.
    I google lot and couldn't able get any working solutions.
    I've emailed you too, i want to take your paid support from you.

  • @prabhakarp9861
    @prabhakarp9861 Рік тому

    Josh is battle-tested in TGIK live streaming, this is nothing for him !

  • @user-11528
    @user-11528 3 роки тому

    hi

  • @ShopperPlug
    @ShopperPlug 2 роки тому

    This is why Linux sucks, it's complete torture to do all of this using the command line.