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

Настройка сетевых служб, маршрутизации, фаерволлов. Проблемы с сетевым оборудованием.
Правила форума
Убедительная просьба юзать теги [code] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
Аватара пользователя
hizel
дядя поня
Сообщения: 9032
Зарегистрирован: 2007-06-29 10:05:02
Откуда: Выборг

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

Непрочитанное сообщение hizel » 2009-11-26 11:25:53

из /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.
 *
 */
В дурацкие игры он не играет. Он просто жуткий, чу-чу, паровозик, и зовут его Блейн. Блейн --- это Боль.

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Аватара пользователя
terminus
майор
Сообщения: 2305
Зарегистрирован: 2007-10-29 11:27:35
Откуда: Рига

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

Непрочитанное сообщение terminus » 2009-11-26 14:01:02

Эту штуку в рамках 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:
Модель: AST-PM-105/0044; Тип: Универсальный, ремонтный; Название: Терминус; Род повреждения: Распад функций; Выводы: Сдать на слом.

Аватара пользователя
hizel
дядя поня
Сообщения: 9032
Зарегистрирован: 2007-06-29 10:05:02
Откуда: Выборг

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

Непрочитанное сообщение hizel » 2009-11-26 14:29:23

это в 8.0-RELEASE

в 7.2-RELEASE-p3 такого нет
В дурацкие игры он не играет. Он просто жуткий, чу-чу, паровозик, и зовут его Блейн. Блейн --- это Боль.

Аватара пользователя
schizoid
подполковник
Сообщения: 3228
Зарегистрирован: 2007-03-03 17:32:31
Откуда: Украина, Чернигов
Контактная информация:

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

Непрочитанное сообщение schizoid » 2009-11-27 12:18:13

а можно для тех, кто в танке? :oops:
ядерный взрыв...смертельно красиво...жаль, что не вечно...

Аватара пользователя
hizel
дядя поня
Сообщения: 9032
Зарегистрирован: 2007-06-29 10:05:02
Откуда: Выборг

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

Непрочитанное сообщение hizel » 2009-11-27 12:29:31

тем кто в танки давно ничего не нужно :D

hint: сматри на ascii-картинку
В дурацкие игры он не играет. Он просто жуткий, чу-чу, паровозик, и зовут его Блейн. Блейн --- это Боль.

harmless
лейтенант
Сообщения: 719
Зарегистрирован: 2007-08-23 10:56:51
Откуда: Украина, г. Киев, г. Белая Церковь
Контактная информация:

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

Непрочитанное сообщение harmless » 2011-10-18 18:07:56

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

Аватара пользователя
hizel
дядя поня
Сообщения: 9032
Зарегистрирован: 2007-06-29 10:05:02
Откуда: Выборг

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

Непрочитанное сообщение hizel » 2011-10-19 13:56:22

кто вам мешает посмотреть самому?
В дурацкие игры он не играет. Он просто жуткий, чу-чу, паровозик, и зовут его Блейн. Блейн --- это Боль.

harmless
лейтенант
Сообщения: 719
Зарегистрирован: 2007-08-23 10:56:51
Откуда: Украина, г. Киев, г. Белая Церковь
Контактная информация:

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

Непрочитанное сообщение harmless » 2011-10-20 0:14:10

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]-->--|             | |
                    +---------+              +-------------+ |
                                               +-------------+