Страница 1 из 1

pipe & queue

Добавлено: 2008-02-11 22:05:54
FreePascal
вот на пример есть такое вот

Код: Выделить всё

>ipfw pipe show
00001: 512.000 Kbit/s    0 ms  100 sl. 0 queues (1 buckets) droptail
00002:  50.000 Kbit/s    0 ms   50 sl. 0 queues (1 buckets) droptail
q00001: weight 50 pipe 1  100 sl. 2 queues (64 buckets) droptail
    mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
 25 ip           0.0.0.0/0      192.168.220.72/0     32081 45045735  0    0  26
 33 ip           0.0.0.0/0     192.168.220.176/0     5457  7548289  0    0  39
q00002: weight 50 pipe 1  100 sl. 1 queues (64 buckets) droptail
    mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
 33 ip           0.0.0.0/0     192.168.220.176/0     1268   190570  0    0   0
q00003: weight 50 pipe 2  100 sl. 2 queues (64 buckets) droptail
    mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
 25 ip           0.0.0.0/0      192.168.220.72/0      180    19828  0    0   0
 33 ip           0.0.0.0/0     192.168.220.176/0        8      448  0    0   0
Есть переменная ядра net.inet.ip.dummynet.expire при значении "1" которой удаляются очереди через некоторое время.

Какой переменной, или как устанавливается ето время???

Re: pipe & queue

Добавлено: 2008-02-11 22:28:34
zingel
Если не ошибаюсь, то net.inet.ip.dummynet.curr_time

Re: pipe & queue

Добавлено: 2008-02-11 22:52:03
FreePascal
zingel писал(а):Если не ошибаюсь, то net.inet.ip.dummynet.curr_time
Ето current time по UNIX времени

Re: pipe & queue

Добавлено: 2008-02-11 23:03:35
zingel
походуй, такой нет:

Код: Выделить всё

/usr/src/sys/netinet/ip_dummynet.c
..........
#include <sys/time.h>
 * We keep a private variable for the simulation time, but we could
 * probably use an existing one ("softticks" in sys/kern/kern_timeout.c)
static dn_key curr_time = 0 ; /* current simulation time */
static struct timeval prev_t, t;
/* Adjusted vs non-adjusted curr_time difference (ticks). */
static struct callout dn_timeout;
SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, curr_time,
    CTLFLAG_RD, &curr_time, 0, "Current tick");
    "Adjusted vs non-adjusted curr_time difference (ticks).");
 * time of the packet.
 * event handled is the finish time of the head pkt.
 * event handled is the start time of the head pkt.
                if (!DN_KEY_LEQ(pkt->output_time, curr_time))
                heap_insert(&extract_heap, pkt->output_time, pipe);
 * extract pkt from queue, compute output time (could be now)
    dt->output_time = curr_time + p->delay ;
 * ready_event() is invoked every time the queue must enter the
     * the delay line (in p) computing output time.
    q->numbytes += ( curr_time - q->sched_time ) * p->bandwidth;
     * To this purpose we record the current time and compute how many
     * ticks to go for the finish time of the packet.
        q->sched_time = curr_time ;
        heap_insert(&ready_heap, curr_time + t, (void *)q );
         * queue on error hoping next time we are luckier.
        q->q_time = curr_time;
 * the queues at their start time, and enqueue into the delay line.
        p->numbytes += ( curr_time - p->sched_time ) * p->bandwidth;
            q->S = q->F ; /* update start time */
     * Also fix the delivery time of the last packet.
        dn_tag_get(p->tail)->output_time += t ;
        p->sched_time = curr_time ;
        heap_insert(&wfq_ready_heap, curr_time + t, (void *)p);
         * queue on error hoping next time we are luckier.
        getmicrouptime(&t);
         * Adjust curr_time if accumulated tick difference greater than
         * 'standard' tick. Since curr_time should be monotonically increasing,
         * we do positive adjustment as required and throttle curr_time in
        curr_time++;
                curr_time += diff;
                curr_time--;
                while (h->elements > 0 && DN_KEY_LEQ(h->p[0].key, curr_time)) {
                        if (h->p[0].key > curr_time)
                                    i, (int)(curr_time - h->p[0].key));
                                /* Mark timestamp as invalid. */
        callout_reset(&dn_timeout, 1, dummynet, NULL);
    if (fs->last_expired == time_uptime)
    fs->last_expired = time_uptime ;
    q->S = q->F + 1;   /* hack - mark timestamp as invalid */