SlideShare a Scribd company logo
Dive into TC – TC basics

        Jeromy Fu
Agenda
• What’s TC

• How it works

• Basic concepts

• Command and parameters
What’s TC
• TC is abbr. of Traffic Control
  - Rate control
  - Bandwidth management
  - Active Queue Management(AQM)
  - Network Emulator, pkt loss, pkt disorder, pkt
  duplication, pkt delay
  - QoS ( diffserv + rsvp )
  - Many more …
What’s tc
• user-level utilities iproute2( iproute2/tc )
• tc kernel (linux/net/sched)
How it works
How it works
Basic concepts- Qdisc
• Qdisc(Queue discipline)
  - Decide which ones to send first, which ones to delay, and which
  ones to drop
  - class/classful Qdisc: Qdisc with/without configurable internal
  subdivision

• Naming convention:
  - Kernel: sch_*.c (sch_netem.c, sch_tbf.c )
  - iproute2: q_*.c (q_netem.c, q_tbf.c)
Qdisc list
•   Class Based Queueing (CBQ)
•   Hierarchical Token Bucket (HTB)
•   Hierarchical Fair Service Curve (HFSC)
•   ATM Virtual Circuits (ATM)
•   Multi Band Priority Queueing (PRIO)
•   Hardware Multiqueue-aware Multi Band Queuing (MULTIQ)
•   Random Early Detection (RED)
•   Stochastic Fairness Queueing (SFQ)
•   True Link Equalizer (TEQL)
•   Token Bucket Filter (TBF)
•   Generic Random Early Detection (GRED)
•   Differentiated Services marker (DSMARK)
•   Network emulator (NETEM)
•   Deficit Round Robin scheduler (DRR)
•   Ingress Qdisc
Basic concepts- Classification
• Classification(Filter)
  - Used to distinguish among different classes of packets
  and process each class in a specific way.

• Naming convention:
  - Kernel: cls_*.c (cls_u32.c, cls_rsvp.c )
  - iproute2: f_*.c (f_u32.c, f_rsvp.c)
Classification list
•   Elementary classification (BASIC)
•   Traffic-Control Index (TCINDEX)
•   Routing decision (ROUTE)
•   Netfilter mark (FW)
•   Universal 32bit comparisons w/ hashing (U32)
•   IPv4 Resource Reservation Protocol (RSVP)
•   IPv6 Resource Reservation Protocol (RSVP6)
•   Flow classifier
•   Control Group Classifier
•   Extended Matches
•   Metadata
•   Incoming device classification
Basic concepts- Action
• Action
  Actions get attached to classifiers and are invoked after
  a successful classification. They are used to overwrite
  the classification result, instantly drop or redirect
  packets, etc. Works on ingress only.

• Naming convention:
  - Kernel: act_*.c (act_police.c, act_skbedit.c )
  - iproute2: m_*.c (m_police.c, m_pedit.c)
Action list
•   Traffic Policing
•   Generic actions
•   Probability support
•   Redirecting and Mirroring
•   IPtables targets
•   Stateless NAT
•   Packet Editing
•   SKB Editing
Basic concepts- Class
• Classes either contain other Classes, or a Qdisc
  is attached
• Qdiscs and Classes are intimately tied together
TC Commands
• OPTIONS: options are effective for all sub
  commands
• OBJECTS: the object of the tc command
  operates on
• COMMAND: the sub command for each object
TC Commands
TC Qdisc
• Operations on qdisc: add | del | replace |
  change | show
• Handle: qdisc handle used to identify qdisc
• root|ingress|parent CLASSID, specify the
  parent node
qdisc handle
• Qdisc handle is used to identify Qdisc
  - {none|major[:]}
  - none is TC_H_UNSPEC
  - major is 16bits HEX number(Without ‘0x’ prefix)
  - : is optional

• Internally, qdisc_handle = major<<16
classid
• Classid is used to identify Class

  - {none|root|[major]:minor}

  - none is TC_H_UNSPEC, root is TC_H_ROOT

  - major/minor are both 16bits HEX numbers(Without
  ‘0x’ prefix), major is optional

• Internally, classid = (major<<16)|minor
stab and rtab
• stab is Size table, rtab is rate table.
• They’re used to speed up the calculation of
  the transmit time of packets.
• The packet size is aligned to a predefined size
  in the stab slot.
• Then the rtab is used to give the pre-
  calculated time of the aligned packet size.
Linklayer
• Link layer affects packet size, if linklayer is
  set, both mpu and overhead must also be set
Linklayer
stab internal
• szopts: stab relating specifications, some are
  specified by the command, some are
  calculated
• data: the size table.
stab internal - user space
• Averagely distribute(*2) the MTU size into size
  table which has tsize slots
stab internal - kernel
rtab internal - user space
• rtab size is constantly 256
rtab internal - kernel
Measure units
• Rate
Measure units
• Size
Measure units
• time
TC Class
• Tc class can only be applied for classful
  qdisc, such as htb, cbq etc
example
• TBF



• HTB
tbf
• limit/latency
• buffer/burst/maxburst, capcity of token
  bucket: size[/cell]
• mpu: minimum process unit
• rate/peakrate
• Max(Rate/HZ,MTU)
tbf - user space
• latency convert to limit finally
tbf - user space
• rtab initialization
tbf - kernel
tbf - kernel
Tbf dequeue
Ad

More Related Content

What's hot (20)

Demystify eBPF JIT Compiler
Demystify eBPF JIT CompilerDemystify eBPF JIT Compiler
Demystify eBPF JIT Compiler
Netronome
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
Brendan Gregg
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
Michelle Holley
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
Thomas Graf
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
Brendan Gregg
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
Thomas Graf
 
DevConf 2014 Kernel Networking Walkthrough
DevConf 2014   Kernel Networking WalkthroughDevConf 2014   Kernel Networking Walkthrough
DevConf 2014 Kernel Networking Walkthrough
Thomas Graf
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
Daniel T. Lee
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
hugo lu
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDK
Kernel TLV
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
Kernel TLV
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDPDockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
Thomas Graf
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
lcplcp1
 
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to Userspace
SUSE Labs Taipei
 
DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingDPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet Processing
Michelle Holley
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
Kernel TLV
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
Alexei Starovoitov
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
Shu Sugimoto
 
Linux kernel tracing
Linux kernel tracingLinux kernel tracing
Linux kernel tracing
Viller Hsiao
 
Demystify eBPF JIT Compiler
Demystify eBPF JIT CompilerDemystify eBPF JIT Compiler
Demystify eBPF JIT Compiler
Netronome
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
Brendan Gregg
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
Michelle Holley
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
Thomas Graf
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
Brendan Gregg
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
Thomas Graf
 
DevConf 2014 Kernel Networking Walkthrough
DevConf 2014   Kernel Networking WalkthroughDevConf 2014   Kernel Networking Walkthrough
DevConf 2014 Kernel Networking Walkthrough
Thomas Graf
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
Daniel T. Lee
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
hugo lu
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDK
Kernel TLV
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
Kernel TLV
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDPDockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
Thomas Graf
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
lcplcp1
 
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to Userspace
SUSE Labs Taipei
 
DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingDPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet Processing
Michelle Holley
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
Kernel TLV
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
Alexei Starovoitov
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
Shu Sugimoto
 
Linux kernel tracing
Linux kernel tracingLinux kernel tracing
Linux kernel tracing
Viller Hsiao
 

Similar to Tc basics (20)

Cache aware hybrid sorter
Cache aware hybrid sorterCache aware hybrid sorter
Cache aware hybrid sorter
Manchor Ko
 
Network emulator
Network emulatorNetwork emulator
Network emulator
jeromy fu
 
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Bruno Castelucci
 
Paralell
ParalellParalell
Paralell
Mark Vicuna
 
Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase
HBaseCon
 
Mum bandwidth management and qos
Mum   bandwidth management and qosMum   bandwidth management and qos
Mum bandwidth management and qos
Teav Sovandara
 
High performace network of Cloud Native Taiwan User Group
High performace network of Cloud Native Taiwan User GroupHigh performace network of Cloud Native Taiwan User Group
High performace network of Cloud Native Taiwan User Group
HungWei Chiu
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt Communication
Andreas Jakl
 
CS345 09 - Ch04 Threads operating system1.pptx
CS345 09 - Ch04 Threads operating system1.pptxCS345 09 - Ch04 Threads operating system1.pptx
CS345 09 - Ch04 Threads operating system1.pptx
RichaAgnihotri13
 
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Cheng-Chun William Tu
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
Denys Haryachyy
 
400-101 CCIE Routing and Switching IT Certification
400-101 CCIE Routing and Switching IT Certification400-101 CCIE Routing and Switching IT Certification
400-101 CCIE Routing and Switching IT Certification
wrouthae
 
8 Tc
8 Tc8 Tc
8 Tc
gobed
 
Brkdct 3101
Brkdct 3101Brkdct 3101
Brkdct 3101
Nguyen Van Linh
 
mTCP使ってみた
mTCP使ってみたmTCP使ってみた
mTCP使ってみた
Hajime Tazaki
 
CNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis ToolsCNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis Tools
Sam Bowne
 
lect13_programmable_dp.pptx
lect13_programmable_dp.pptxlect13_programmable_dp.pptx
lect13_programmable_dp.pptx
SidharthSharma546629
 
Real-Time Analytics with Kafka, Cassandra and Storm
Real-Time Analytics with Kafka, Cassandra and StormReal-Time Analytics with Kafka, Cassandra and Storm
Real-Time Analytics with Kafka, Cassandra and Storm
John Georgiadis
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
Thomas Graf
 
Cache aware hybrid sorter
Cache aware hybrid sorterCache aware hybrid sorter
Cache aware hybrid sorter
Manchor Ko
 
Network emulator
Network emulatorNetwork emulator
Network emulator
jeromy fu
 
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Bruno Castelucci
 
Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase
HBaseCon
 
Mum bandwidth management and qos
Mum   bandwidth management and qosMum   bandwidth management and qos
Mum bandwidth management and qos
Teav Sovandara
 
High performace network of Cloud Native Taiwan User Group
High performace network of Cloud Native Taiwan User GroupHigh performace network of Cloud Native Taiwan User Group
High performace network of Cloud Native Taiwan User Group
HungWei Chiu
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt Communication
Andreas Jakl
 
CS345 09 - Ch04 Threads operating system1.pptx
CS345 09 - Ch04 Threads operating system1.pptxCS345 09 - Ch04 Threads operating system1.pptx
CS345 09 - Ch04 Threads operating system1.pptx
RichaAgnihotri13
 
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Cheng-Chun William Tu
 
400-101 CCIE Routing and Switching IT Certification
400-101 CCIE Routing and Switching IT Certification400-101 CCIE Routing and Switching IT Certification
400-101 CCIE Routing and Switching IT Certification
wrouthae
 
8 Tc
8 Tc8 Tc
8 Tc
gobed
 
CNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis ToolsCNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis Tools
Sam Bowne
 
Real-Time Analytics with Kafka, Cassandra and Storm
Real-Time Analytics with Kafka, Cassandra and StormReal-Time Analytics with Kafka, Cassandra and Storm
Real-Time Analytics with Kafka, Cassandra and Storm
John Georgiadis
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
Thomas Graf
 
Ad

Recently uploaded (20)

Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Ad

Tc basics

  • 1. Dive into TC – TC basics Jeromy Fu
  • 2. Agenda • What’s TC • How it works • Basic concepts • Command and parameters
  • 3. What’s TC • TC is abbr. of Traffic Control - Rate control - Bandwidth management - Active Queue Management(AQM) - Network Emulator, pkt loss, pkt disorder, pkt duplication, pkt delay - QoS ( diffserv + rsvp ) - Many more …
  • 4. What’s tc • user-level utilities iproute2( iproute2/tc ) • tc kernel (linux/net/sched)
  • 7. Basic concepts- Qdisc • Qdisc(Queue discipline) - Decide which ones to send first, which ones to delay, and which ones to drop - class/classful Qdisc: Qdisc with/without configurable internal subdivision • Naming convention: - Kernel: sch_*.c (sch_netem.c, sch_tbf.c ) - iproute2: q_*.c (q_netem.c, q_tbf.c)
  • 8. Qdisc list • Class Based Queueing (CBQ) • Hierarchical Token Bucket (HTB) • Hierarchical Fair Service Curve (HFSC) • ATM Virtual Circuits (ATM) • Multi Band Priority Queueing (PRIO) • Hardware Multiqueue-aware Multi Band Queuing (MULTIQ) • Random Early Detection (RED) • Stochastic Fairness Queueing (SFQ) • True Link Equalizer (TEQL) • Token Bucket Filter (TBF) • Generic Random Early Detection (GRED) • Differentiated Services marker (DSMARK) • Network emulator (NETEM) • Deficit Round Robin scheduler (DRR) • Ingress Qdisc
  • 9. Basic concepts- Classification • Classification(Filter) - Used to distinguish among different classes of packets and process each class in a specific way. • Naming convention: - Kernel: cls_*.c (cls_u32.c, cls_rsvp.c ) - iproute2: f_*.c (f_u32.c, f_rsvp.c)
  • 10. Classification list • Elementary classification (BASIC) • Traffic-Control Index (TCINDEX) • Routing decision (ROUTE) • Netfilter mark (FW) • Universal 32bit comparisons w/ hashing (U32) • IPv4 Resource Reservation Protocol (RSVP) • IPv6 Resource Reservation Protocol (RSVP6) • Flow classifier • Control Group Classifier • Extended Matches • Metadata • Incoming device classification
  • 11. Basic concepts- Action • Action Actions get attached to classifiers and are invoked after a successful classification. They are used to overwrite the classification result, instantly drop or redirect packets, etc. Works on ingress only. • Naming convention: - Kernel: act_*.c (act_police.c, act_skbedit.c ) - iproute2: m_*.c (m_police.c, m_pedit.c)
  • 12. Action list • Traffic Policing • Generic actions • Probability support • Redirecting and Mirroring • IPtables targets • Stateless NAT • Packet Editing • SKB Editing
  • 13. Basic concepts- Class • Classes either contain other Classes, or a Qdisc is attached • Qdiscs and Classes are intimately tied together
  • 14. TC Commands • OPTIONS: options are effective for all sub commands • OBJECTS: the object of the tc command operates on • COMMAND: the sub command for each object
  • 16. TC Qdisc • Operations on qdisc: add | del | replace | change | show • Handle: qdisc handle used to identify qdisc • root|ingress|parent CLASSID, specify the parent node
  • 17. qdisc handle • Qdisc handle is used to identify Qdisc - {none|major[:]} - none is TC_H_UNSPEC - major is 16bits HEX number(Without ‘0x’ prefix) - : is optional • Internally, qdisc_handle = major<<16
  • 18. classid • Classid is used to identify Class - {none|root|[major]:minor} - none is TC_H_UNSPEC, root is TC_H_ROOT - major/minor are both 16bits HEX numbers(Without ‘0x’ prefix), major is optional • Internally, classid = (major<<16)|minor
  • 19. stab and rtab • stab is Size table, rtab is rate table. • They’re used to speed up the calculation of the transmit time of packets. • The packet size is aligned to a predefined size in the stab slot. • Then the rtab is used to give the pre- calculated time of the aligned packet size.
  • 20. Linklayer • Link layer affects packet size, if linklayer is set, both mpu and overhead must also be set
  • 22. stab internal • szopts: stab relating specifications, some are specified by the command, some are calculated • data: the size table.
  • 23. stab internal - user space • Averagely distribute(*2) the MTU size into size table which has tsize slots
  • 24. stab internal - kernel
  • 25. rtab internal - user space • rtab size is constantly 256
  • 26. rtab internal - kernel
  • 30. TC Class • Tc class can only be applied for classful qdisc, such as htb, cbq etc
  • 32. tbf • limit/latency • buffer/burst/maxburst, capcity of token bucket: size[/cell] • mpu: minimum process unit • rate/peakrate • Max(Rate/HZ,MTU)
  • 33. tbf - user space • latency convert to limit finally
  • 34. tbf - user space • rtab initialization