From owner-freebsd-ipfw@FreeBSD.ORG Thu Nov 25 18:05:11 2010 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81471065679 for ; Thu, 25 Nov 2010 18:05:11 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 7CC9E8FC15 for ; Thu, 25 Nov 2010 18:05:11 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id DECF4730A1; Thu, 25 Nov 2010 19:18:25 +0100 (CET) Date: Thu, 25 Nov 2010 19:18:25 +0100 From: Luigi Rizzo To: nangergong Message-ID: <20101125181825.GA79947@onelab2.iet.unipi.it> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-ipfw@freebsd.org Subject: Re: two questions:1 relationship between dummynet and wireshark 2 how to add latency for each packet to be sent X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2010 18:05:11 -0000 On Thu, Nov 25, 2010 at 03:31:16PM +0000, nangergong wrote: > Hi, all: > > 1 relationship between dummynet and wireshark > > I have a question on the relationship between dummynet and wireshark. Does > wireshark capture packets before dummynet starts working or after? Which of > the following charts is right? > > (1) > send packets > capture add pkt loss, delay.. > A------------------> wireshark --------------------> > dummynet---------------------------> > > add pkt > loss,delay... capture > network----------------->dummynet -------------------------> > wireshark-------------> B > > or > > (2) > send packets add delay,loss > capture > A------------------> dummynet --------------------> > wireshakr---------------------------> > > add pkt > loss,delay... capture > network----------------->dummynet -------------------------> > wireshark-------------> B > > At first, I think (1) is right, and I did a test using "ping". However > during my following test, it seems that (2) is the fact: > > I have two machines, A and B. When I play music on A, the RTP packets flow > from A to B. I added a pipe with packet loss and bandwidth limitation, > which regulates the flow from A to B. Then I captured packets on A using > wireshark. If the chart (1) is right, then the packets I captured on A > should be the same to the music I played on A, however, this is not the > truth. > > 2 how to add latency for each packet to be sent > > I want to vary the delays(latencies) for different packets. So, is there a > way to add latency for for each packet to be sent. For example, bind one > pipe to one packet. Thank you! hi, wireshark is closest to the wire so it will intercept incoming traffic before dummynet, and outgoing traffic after dummynet. As for binding pipes to packets, you can only do it if those packets carry metadata (i.e. 5-tuple, length, flags...) that ipfw can match and distinguish one packet from another. Usually, though, this is not the case for packets from the same flow. cheers luigi