lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1322524125.2970.48.camel@edumazet-laptop>
Date:	Tue, 29 Nov 2011 00:48:45 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Hagen Paul Pfeifer <hagen@...u.net>
Cc:	netdev@...r.kernel.org, Stephen Hemminger <shemminger@...tta.com>
Subject: Re: [PATCH v2 net-next 2/2] netem: add cell concept to simulate
 special MAC behavior

Le mardi 29 novembre 2011 à 00:30 +0100, Hagen Paul Pfeifer a écrit :
> * Eric Dumazet | 2011-11-29 00:01:07 [+0100]:
> 
> >> -static psched_time_t packet_len_2_sched_time(unsigned int len, u32 rate)
> >> +static psched_time_t packet_len_2_sched_time(unsigned int len,
> >> +					     struct netem_sched_data *q)
> >>  {
> >> -	return PSCHED_NS2TICKS((u64)len * NSEC_PER_SEC / rate);
> >> +	len += q->packet_overhead;
> >> +
> >> +	if (q->cell_size) {
> >> +		u32 carry = len % q->cell_size;
> >> +		len += carry;
> >
> >I dont understand this part  (len += carry;)
> 
> Say the original packet is 100 byte, cellsize is 40 byte: three full size link
> layer frames are required: 40 + 40 + 40 == 100 + 20. This is used for TDMA,
> ATM or slot schemes where the remainder cannot be used.
> 

I still dont understand.

Say you send 119 bytes

119 % 40 = 39

119 + 39 = 158

Is it was is really needed ?

> Later in code carry is reused if cell overhead is configured.
> 

In this example, cells will be :

158 / 40 = 3   + one (because carry is not 0)

len += 4 * cell_overhead



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ