DOC PREVIEW
U of I CS 498 - Traffic Control for QoS

This preview shows page 1-2-15-16-31-32 out of 32 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 498 Lecture 9Traffic Control for QoSJennifer HouDepartment of Computer Science University of Illinois at Urbana-ChampaignReading: Chapters 18, The Linux Networking Architecture: Design and Implementation of Network Protocols in the Linux KernelTraffic ControlTwo major functionsz Policingz Usually implemented at the router.z Data connections are monitored and packets that are transmitted violating a specified strategy are discarded.z Traffic shapingz Usually implemented at end hosts.z Data connections are regulated to conform to certain rate. Surplus packets are either marked and then sent or delayed at the sender side until the rate constraint no longer holds true.Processing of Network DataInput de-multiplexing Forwarding Output queuingUpper layers (TCP, UDP, …)Traffic controlIngress policingTraffic Control in Linux Kernelnet/core/dev.cdriver.cnet/ipv4/ip_input.cnet/sched/sch_ingress.cTraffic control inIncoming directionForwardingLocal delivery Locally created datanet/core/dev.cdev_queue_xmitnet/sched/sch_*.cnet/sched/cls_*.cTraffic control inouting directiondev-> hard_start_xmitTraffic Control in Linux Kernel..........dev.cdev.cdev.cdev.cdriver.cdriver.cnet_interruptnetif_rxnet_rx_actionSchedulerdo_softirqbr_input.cbr_input.chandle_bridgeCONFIG_BRIDGEdev_alloc_skb()eth_type_trans()CPU1 CPU2softnet_data[cpun].input_pkt_queuearp_rcv ip_rcvp8022_rcvdev.cdev.cdev_queue_xmitdev->qdisc->enqueuedev.cdev.cdriver.cdriver.cdev->hard_start_xmitqdisc_runqdisc_restartdev->qdisc->dequeueSchedulereth0eth1ip_queue_xmitarp_send...net_tx_actionETH_P_802_2Components of Traffic ControlQueuing disciplinesz Packets sent are passed to a queueing discipline and sorted within the queue in compliance with specific rules.z Packets can be removed no earlier than when the queueing discipline has marked them as ready for transmission.Classes (within a queuing disciplines)z Within a queue discipline, packets can be allocated to different classes.Filters: are used to allocate packets to classes with a queueing discipline.Queuing DisciplineEach network device has a queuing disciplineIt controls how packets are enqueuedon the device are treatedz Possible operations: keep, drop, mark A simple one may just consist of a single queueQueuing disciplineComplex Queuing DisciplineQueuing disciplinez May use filters to distinguish among different classes of packetsz Process each class in a specific wayz Two filters can point to one classClasses z do not store packetsz They use another queuing discipline to do thatQueueing disciplineFilter Filter FilterClass 2Class 1QueueingDisciplineQueueingDisciplineEnqueuedequeueComplex Queuing DisciplinePolicingWhen packets of a connection are enqueued, the connection can be policed:z Letting the packets goz Dropping the packetsz Letting the packets go but mark themData StructuresInclude/net/pkt_sched.hInclude/net/sch_generic.hTraffic Control in Linux KernelTraffic control kernel code resides mainly in net/schedz Traffic control in the incoming direction is handled by net/sched/sch_ingress.c.z Various scheduling disciplines in the outgoing direction are given in z net/sched/sch_*.cz net/sched/cls_*.cTraffic Control in Linux KernelInterface used inside the kernel can be found inz /usr/src/linux-(version)/include/net/pkt_cls.hz /usr/src/linux-(version)/include/net/pket_sched.hInterfaces between kernel traffic control and user space programs are decared inz /usr/include/linux/pkt_cls.hz /usr/include/linux/pkt_sched.h.Inserting Traffic Controldev.c, net/sched/*dev.c, net/sched/*softirq.c, netdevice.hsoftirq.c, netdevice.hdev->qdisc->enqueuedriver.cdriver.cdev->hard_start_xmitqdisc_runqdisc_restart dev->qdisc->dequeueSchedulernet_tx_actiondev_queue_xmittimer_handler netif_scheduleTimercpu_raise_softirqdo_softirqNET_TX_SOFTIRQQueueing disciplineFilter Filter FilterClass 2Class 1QueueingDisciplineQueueingDisciplineEnqueuedequeueQueueing Discipline -- Qdiscstruct Qdisc{int (*enqueue)(struct sk_buff *skb,struct Qdisc *dev);struct sk_buff * (*dequeue)(struct Qdisc *dev);unsigned flags;32#define TCQ_F_BUILTIN 1#define TCQ_F_THROTTLED 2#define TCQ_F_INGRESS 4int padded;struct Qdisc_ops *ops;u32 handle;u32 parent;atomic_t refcnt;struct sk_buff_head q;struct net_device *dev;struct list_head list;struct gnet_stats_basic bstats;struct gnet_stats_queue qstats;struct gnet_stats_rate_est rate_est;spinlock_t *stats_lock;struct rcu_head q_rcu;int (*reshape_fail)(struct sk_buff *skb,struct Qdisc*q);struct Qdisc*__parent;The network device to which the Qdisc isallocatedThe Qdisc_ops data structureThe socket buffer queue governed bythis qdiscWhen an outer queue passes a packet to an inner queuethe packet may have to be discarded. If the outer queueing discipline implements the callback functionreshape_fail then it can be invoked by the inner queueingdiscipline.Queuing Disciplines –Qdisc_opsstruct Qdisc_ops { struct Qdisc_ops*next; struct Qdisc_class_ops*cl_ops;char id[IFNAMSIZ];int priv_size;int (*enqueue)(struct sk_buff*, struct Qdisc *);struct sk_buff* (*dequeue)(struct Qdisc *);int (*requeue)(struct sk_buff*, struct Qdisc *);unsigned int (*drop)(struct Qdisc*);int (*init)(struct Qdisc *, struct rtattr *arg);void (*reset)(struct Qdisc *);void (*destroy)(struct Qdisc*);int (*change)(struct Qdisc*, struct rtattr *arg);int (*dump)(struct Qdisc *, struct sk_buff *);};The packet should bearranged at the positionin the queueing disciplinewhere it has been beforeA queueing discipline can be added via register_qdisc() in init_module()Qdisc_opsenqueue()z Enqueues a packetz Return values arez NET_XMIT_SUCCESS, if the packet is acceptedz NET_XMIT_DROP, if the packet is discardedz NET_XMIT_CN, if the packet is discarded because of buffer overflowz NET_XMIT_POLICED, if the packet is discarded because of violation of a policing rule.z NET_XMIT_BYPASS, if the packet is accepted, but will not leave the queue via the regular dequeue() function.Qdisc_opsdequeue()z Returns a pointer to a packet (skb) eligible for sendingz A return value of null means that there are no packets ready to be sent. (The total number of packets in the queue is given in struct Qdisc* qÆq.len.)requeue()z Puts a packet back into the original position in the queue where it had been before.z The number of packets running through the queue should not be increased. drop()z Drops one packet from the queueQdisc_opsinit()z Initializes the queuing disciplinereset()z Resets the queuing


View Full Document

U of I CS 498 - Traffic Control for QoS

Documents in this Course
Lecture 5

Lecture 5

13 pages

LECTURE

LECTURE

39 pages

Assurance

Assurance

44 pages

LECTURE

LECTURE

36 pages

Pthreads

Pthreads

29 pages

Load more
Download Traffic Control for QoS
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Traffic Control for QoS and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Traffic Control for QoS 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?