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

[ipfw] Как много нам открытий чудных

Добавлено: 2009-11-26 11:25:53
hizel
из /usr/src/sys/sbin/ipfw/dummynet.c

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

/*
 * Code to parse delay profiles.
 *
 * Some link types introduce extra delays in the transmission
 * of a packet, e.g. because of MAC level framing, contention on
 * the use of the channel, MAC level retransmissions and so on.
 * From our point of view, the channel is effectively unavailable
 * for this extra time, which is constant or variable depending
 * on the link type. Additionally, packets may be dropped after this
 * time (e.g. on a wireless link after too many retransmissions).
 * We can model the additional delay with an empirical curve
 * that represents its distribution.
 *
 *      cumulative probability
 *      1.0 ^
 *          |
 *      L   +-- loss-level          x
 *          |                 ******
 *          |                *
 *          |           *****
 *          |          *
 *          |        **
 *          |       *
 *          +-------*------------------->
 *                      delay
 *
 * The empirical curve may have both vertical and horizontal lines.
 * Vertical lines represent constant delay for a range of
 * probabilities; horizontal lines correspond to a discontinuty
 * in the delay distribution: the pipe will use the largest delay
 * for a given probability.
 *
 * To pass the curve to dummynet, we must store the parameters
 * in a file as described below, and issue the command
 *
 *      ipfw pipe <n> config ... bw XXX profile <filename> ...
 *
 * The file format is the following, with whitespace acting as
 * a separator and '#' indicating the beginning a comment:
 *
 *      samples N
 *              the number of samples used in the internal
 *              representation (2..1024; default 100);
 *
 *      loss-level L 
 *              The probability above which packets are lost.
 *               (0.0 <= L <= 1.0, default 1.0 i.e. no loss);
 *
 *      name identifier
 *              Optional a name (listed by "ipfw pipe show")
 *              to identify the distribution;
 *
 *      "delay prob" | "prob delay"
 *              One of these two lines is mandatory and defines
 *              the format of the following lines with data points.
 *
 *      XXX YYY
 *              2 or more lines representing points in the curve,
 *              with either delay or probability first, according
 *              to the chosen format.
 *              The unit for delay is milliseconds.
 *
 * Data points does not need to be ordered or equal to the number
 * specified in the "samples" line. ipfw will sort and interpolate
 * the curve as needed.
 *
 * Example of a profile file:
 
        name    bla_bla_bla
        samples 100
        loss-level    0.86
        prob    delay
        0       200     # minimum overhead is 200ms
        0.5     200
        0.5     300
        0.8     1000
        0.9     1300
        1       1300
 
 * Internally, we will convert the curve to a fixed number of
 * samples, and when it is time to transmit a packet we will
 * model the extra delay as extra bits in the packet.
 *
 */

Re: [ipfw] Как много нам открытий чудных

Добавлено: 2009-11-26 14:01:02
terminus
Эту штуку в рамках SoC 2009 написала Marta Carbone ЕМНИП.
Ты в исходниках CURRENT смотрел?

---

http://www.freebsd.org/cgi/man.cgi?quer ... ormat=html

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

     profile filename
	     A file specifying the additional overhead incurred in the trans-
	     mission of a packet on the link.

	     Some link types introduce extra delays in the transmission of a
	     packet, e.g. because of MAC level framing, contention on the use
	     of the channel, MAC level retransmissions and so on.  From our
	     point of view, the channel is effectively unavailable for this
	     extra time, which is constant or variable depending on the link
	     type. Additionally, packets may be dropped after this time (e.g.
	     on a wireless link after too many retransmissions).  We can model
	     the additional delay with an empirical curve that represents its
	     distribution.

			 cumulative probability
			 1.0 ^
			     |
			 L   +-- loss-level	     x
			     |		       ******
			     |		      *
			     |		 *****
			     |		*
			     |	      **
			     |	     *
			     +-------*------------------->
					 delay
	     The empirical curve may have both vertical and horizontal lines.
	     Vertical lines represent constant delay for a range of probabili-
	     ties.  Horizontal lines correspond to a discontinuity in the
	     delay distribution: the pipe will use the largest delay for a
	     given probability.

	     The file format is the following, with whitespace acting as a
	     separator and '#' indicating the beginning a comment:

	     name identifier
		     optional name (listed by "ipfw pipe show") to identify
		     the delay distribution;

	     bw value
		     the bandwidth used for the pipe.  If not specified here,
		     it must be present explicitly as a configuration parame-
		     ter for the pipe;

	     loss-level L
		     the probability above which packets are lost.  (0.0 <= L
		     <= 1.0, default 1.0 i.e. no loss);

	     samples N
		     the number of samples used in the internal representation
		     of the curve (2..1024; default 100);

	     delay prob | prob delay
		     One of these two lines is mandatory and defines the for-
		     mat of the following lines with data points.

	     XXX YYY
		     2 or more lines representing points in the curve, with
		     either delay or probability first, according to the cho-
		     sen format.  The unit for delay is milliseconds.  Data
		     points do not need to be sorted.  Also, tne number of
		     actual lines can be different from the value of the "sam-
		     ples" parameter: ipfw utility will sort and interpolate
		     the curve as needed.

	     Example of a profile file:

		   name    bla_bla_bla
		   samples 100
		   loss-level	 0.86
		   prob    delay
		   0	   200	   # minimum overhead is 200ms
		   0.5	   200
		   0.5	   300
		   0.8	   1000
		   0.9	   1300
		   1	   1300
		   #configuration file end

     The following parameters can be configured for a queue:

Re: [ipfw] Как много нам открытий чудных

Добавлено: 2009-11-26 14:29:23
hizel
это в 8.0-RELEASE

в 7.2-RELEASE-p3 такого нет

Re: [ipfw] Как много нам открытий чудных

Добавлено: 2009-11-27 12:18:13
schizoid
а можно для тех, кто в танке? :oops:

Re: [ipfw] Как много нам открытий чудных

Добавлено: 2009-11-27 12:29:31
hizel
тем кто в танки давно ничего не нужно :D

hint: сматри на ascii-картинку

Re: [ipfw] Как много нам открытий чудных

Добавлено: 2011-10-18 18:07:56
harmless
Трям-трям!
А кто нибудь пробовал прикручивать эти самые профили к трубам?
Интересно взглянуть что получилось)
И еще интересно посмотреть применение RED(GRED) в трубах

Re: [ipfw] Как много нам открытий чудных

Добавлено: 2011-10-19 13:56:22
hizel
кто вам мешает посмотреть самому?

Re: [ipfw] Как много нам открытий чудных

Добавлено: 2011-10-20 0:14:10
harmless
hizel писал(а):кто вам мешает посмотреть самому?
Насколько я понял это профиль нужно использовать вместо red(gred) и его суть такова:

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

prob     delay
0.1      200
0.5      300
0.9      500
1.0      1000
что на протяжении первых 200мс отдавать скорость 10% от ширины трубы,
после следующих 300мс -отдавать 50% ширины трубы,
после еще следующих 500мс - отдавать 90% ширины трубы,
а после 1000мс - всю полосу.
Но после тестирования - как-то на 100мб канала скорость падает и начинает шкребтись еле-еле 30++кб
Еще интересует нововведение sched.
Не совсем понял что с ним делать :pardon:
Картинка из мана не внушает никаких мыслей

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

                            (flow_mask|sched_mask)  sched_mask
                    +---------+   weight Wx  +-------------+
                    |         |->-[flow]-->--|             |-+
               -->--| QUEUE x |   ...        |             | |
                    |         |->-[flow]-->--| SCHEDuler N | |
                    +---------+              |             | |
                        ...                  |             +--[LINK N]-->--
                    +---------+   weight Wy  |             | +--[LINK N]-->--
                    |         |->-[flow]-->--|             | |
               -->--| QUEUE y |   ...        |             | |
                    |         |->-[flow]-->--|             | |
                    +---------+              +-------------+ |
                                               +-------------+