From owner-freebsd-ipfw@FreeBSD.ORG Fri Nov 26 14:43:14 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 BA029106564A for ; Fri, 26 Nov 2010 14:43:14 +0000 (UTC) (envelope-from nangergong@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 360678FC15 for ; Fri, 26 Nov 2010 14:43:13 +0000 (UTC) Received: by bwz2 with SMTP id 2so1979248bwz.13 for ; Fri, 26 Nov 2010 06:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=9Hu4bp15I+fC/YEpQyRU8exXERy0zy+7jmsc0T0dfSw=; b=oXvs/VpIZOJXX1ZAm2DEN6Tdd0WeGGmQdRdqkwGKD1nKM2IxbHXEzQQiXRN/SG9Fvb c8bUEw7mSXeYFYSQaqyNgGOo7cHmXZHnQu1hBUo55ZkAAKZNI/uNGOKpz+UigbuuDQSk ks1r5jYPLYKtPiEqnCDmagQ2cRUPBdrc1na54= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=oQcOVmdKam2lZlEWYNl9jGrv8/cVUydVOuwemI69dvQ74kq+h5mdb/eq31JFLkKWNR E9CoOLCLyF6r8sjsv6JjUOnD/a++dYcva2pdqGi/1l2YaJQYF66CAKFcS0pm48/vBzKK hN/MzGm1FOP+WVz2m2fpctUpbzM6e0W1JDOV8= MIME-Version: 1.0 Received: by 10.204.122.8 with SMTP id j8mr1989610bkr.135.1290782592220; Fri, 26 Nov 2010 06:43:12 -0800 (PST) Received: by 10.204.154.81 with HTTP; Fri, 26 Nov 2010 06:43:12 -0800 (PST) In-Reply-To: <20101125181825.GA79947@onelab2.iet.unipi.it> References: <20101125181825.GA79947@onelab2.iet.unipi.it> Date: Fri, 26 Nov 2010 14:43:12 +0000 Message-ID: From: nangergong To: Luigi Rizzo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Fri, 26 Nov 2010 14:43:14 -0000 Hi=EF=BC=8C Thank you so much for your reply. I used the windows version of dummynet/IPFW, so is it the same that wireshark will intercept incoming traffic before dummynet, and outgoing traffic after dummynet? Coz It is kind of strange according to my ping test: I have two machines, A and B A: 9.161.150.55 B: 9.161.148.72 I configured on A: >ipfw pipe 1 config plr 1 >ipfw add pipe 1 ip from 9.161.150.55 to 9.161.148.72 (from A to B) and then (1 ) ping "9.161.148.72" on A and started capturing packets on both machines I found that there are four "ping request" packets captured on A while no packets are captured on B. (2) ping "9.161.150.55 " on B and capturing packets on both machines I found that there are four "ping request" and four "ping reply" packets on A while only four "request" packets on B. So it seems that the results contradict with "wireshark will intercept incoming traffic before dummynet, and outgoing traffic after dummynet" on Windows version?. However, when I started a softphone call, it seems that "wireshark will intercept outgoing traffic after dummynet" is true? Really confused now! Do you have any idea on this? Thank you! On Thu, Nov 25, 2010 at 6:18 PM, Luigi Rizzo wrote: > 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? Whic= h > 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 usin= g > > 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 on= e > > 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 >