[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tcpreplay-users
Subject:    Re: [Tcpreplay-users] Tcpreplay in single Ethernet interface
From:       steve freyder <steve () freyder ! net>
Date:       2023-05-20 21:37:05
Message-ID: 9a63ed3d-33aa-e5f6-246c-577cffd297d8 () freyder ! net
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

As it turns out, this actually did work several months ago with "tap" 
devices, using version 4.3.2 of tcpreplay - and with this version of 
Ubuntu/kernel:

# uname -a
Linux ubuntu20 5.4.0-144-generic #161-Ubuntu SMP Fri Feb 3 14:49:04 UTC 
2023 x86_64 x86_64 x86_64 GNU/Linux

This test was rewriting the destination IP to that of the local "ens18" 
interface, and there was a script listening for UDP packets on 
INADDR_ANY (FWIW, in this case on port 4431) and that script was able to 
receive the packet produced by tcpreplay-edit that was injected via 
tap0.  At the time, I think tcpreplay version 4.4.2 had just been 
released, so I tested with that, but with 4.4.2, the script did *not* 
receive the packet.  With older kernels and 4.3.2, it also fails - I 
haven't tried newer kernels:

------------------------------------------------------------------------


# tcpreplay-edit -i tap0 -D 0.0.0.0/0:192.168.1.88/32 ... my.pcap

  Actual: 1 packets (1360 bytes) sent in 0.000015 seconds
  Rated: 90666666.6 Bps, 725.33 Mbps, 66666.66 pps
  Statistics for network device: tap0
     Successful packets:        1
     Failed packets:            0
     Truncated packets:         0
     Retried packets (ENOBUFS): 0
     Retried packets (EAGAIN):  0

# ip a s ens18

2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel 
state UP group default qlen 1000
     link/ether 36:46:97:26:fb:36 brd ff:ff:ff:ff:ff:ff
     inet 192.168.1.88/24 brd 192.168.1.255 scope global ens18
        valid_lft forever preferred_lft forever


# diff --side-by-side <(/usr/bin/tcpreplay-edit --version 2>&1) 
<(/usr/local/bin/tcpreplay-edit --version 2>&1)
tcpreplay version: 4.3.2 (build git:v4.3.2) (debug)           | 
tcpreplay version: 4.4.2 (build git:)
Copyright 2013-2018 by Fred Klassen <tcpreplay at appneta dot | 
Copyright 2013-2022 by Fred Klassen <tcpreplay at appneta dot
Copyright 2000-2012 by Aaron Turner <aturner at synfin dot ne   
Copyright 2000-2012 by Aaron Turner <aturner at synfin dot ne
The entire Tcpreplay Suite is licensed under the GPLv3 The entire 
Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04 Cache file supported: 04
Not compiled with libdnet. Not compiled with libdnet.
Compiled against libpcap: 1.9.1 Compiled against libpcap: 1.9.1
64 bit packet counters: enabled 64 bit packet counters: enabled
Verbose printing via tcpdump: enabled Verbose printing via tcpdump: enabled
Packet editing: enabled Packet editing: enabled
Fragroute engine: disabled Fragroute engine: disabled
Injection method: PF_PACKET send() Injection method: PF_PACKET send()
Not compiled with netmap Not compiled with netmap

------------------------------------------------------------------------


Best regards,

Steve



On 5/17/2023 9:32 PM, Aaron Turner wrote:
> Can’t send packets to the local host.
> 
> -Aaron
> 
> 
> > On May 17, 2023, at 11:07 AM, Somasekhar K<soma6610@gmail.com>  wrote:
> > 
> > 
> > Hi,
> > I have a requirement to use tcpreplay in a single Ethernet interface.
> > For example if the Ethernet interface name is eth0.
> > I am now to capture packets via tcpdump
> > #tcpdump -i eth0 -w data.pcap udp
> > 
> > However when I use
> > # tcpreplay -i eth0 data.pcap
> > I am unable to receive the data in socket.. can u kindly provide me solution to \
> > this problem.. my constraint is I am having single Ethernet interface . 
> > -regards,
> > Som
> > 
> > 
> > 
> > 
> > _______________________________________________
> > Tcpreplay-users mailing list
> > Tcpreplay-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
> > Support Information:http://tcpreplay.synfin.net/trac/wiki/Support
> 
> _______________________________________________
> Tcpreplay-users mailing list
> Tcpreplay-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
> Support Information:http://tcpreplay.synfin.net/trac/wiki/Support


[Attachment #5 (text/html)]

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font face="Courier New, Courier, monospace">Hello,</font></p>
    <p><font face="Courier New, Courier, monospace">As it turns out,
        this actually did work several months ago with "tap" devices,
        using version 4.3.2 of tcpreplay - and with this version of
        Ubuntu/kernel:</font></p>
    <p><font face="Courier New, Courier, monospace"># uname -a<br>
        Linux ubuntu20 5.4.0-144-generic #161-Ubuntu SMP Fri Feb 3
        14:49:04 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux</font></p>
    <p><font face="Courier New, Courier, monospace">This test was
        rewriting the destination IP to that of the local "ens18"
        interface, and there was a script listening for UDP packets on
        INADDR_ANY (FWIW, in this case on port 4431) and that script was
        able to receive the packet produced by tcpreplay-edit that was
        injected via tap0.  At the time, I think tcpreplay version 4.4.2
        had just been released, so I tested with that, but with 4.4.2,
        the script did *not* receive the packet.  With older kernels and
        4.3.2, it also fails - I haven't tried newer kernels:</font></p>
    <hr width="100%" size="2">
    <p><font face="Courier New, Courier, monospace"><br>
      </font></p>
    <p><font face="Courier New, Courier, monospace"># tcpreplay-edit -i
        tap0 -D 0.0.0.0/0:192.168.1.88/32 ... my.pcap<br>
      </font></p>
    <p><font face="Courier New, Courier, monospace"> Actual: 1 packets
        (1360 bytes) sent in 0.000015 seconds<br>
         Rated: 90666666.6 Bps, 725.33 Mbps, 66666.66 pps<br>
         Statistics for network device: tap0<br>
            Successful packets:        1<br>
            Failed packets:            0<br>
            Truncated packets:         0<br>
            Retried packets (ENOBUFS): 0<br>
            Retried packets (EAGAIN):  0<br>
      </font><br>
    </p>
    <p><font face="Courier New, Courier, monospace"># ip a s ens18<br>
      </font></p>
    <p><font face="Courier New, Courier, monospace">2: ens18:
        &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel
        state UP group default qlen 1000<br>
            link/ether 36:46:97:26:fb:36 brd ff:ff:ff:ff:ff:ff<br>
            inet 192.168.1.88/24 brd 192.168.1.255 scope global ens18<br>
               valid_lft forever preferred_lft forever<br>
      </font></p>
    <p><font face="Courier New, Courier, monospace"><br>
      </font> </p>
    <font face="Courier New, Courier, monospace">
    </font>
    <p><font face="Courier New, Courier, monospace"># diff
        --side-by-side &lt;(/usr/bin/tcpreplay-edit --version
        2&gt;&amp;1) &lt;(/usr/local/bin/tcpreplay-edit --version
        2&gt;&amp;1)<br>
        tcpreplay version: 4.3.2 (build git:v4.3.2) (debug)           |
        tcpreplay version: 4.4.2 (build git:)<br>
        Copyright 2013-2018 by Fred Klassen &lt;tcpreplay at appneta dot
        | Copyright 2013-2022 by Fred Klassen &lt;tcpreplay at appneta
        dot<br>
        Copyright 2000-2012 by Aaron Turner &lt;aturner at synfin dot
        ne   Copyright 2000-2012 by Aaron Turner &lt;aturner at synfin
        dot ne<br>
        The entire Tcpreplay Suite is licensed under the GPLv3         
        The entire Tcpreplay Suite is licensed under the GPLv3<br>
        Cache file supported: 04                                       
        Cache file supported: 04<br>
        Not compiled with libdnet.                                     
        Not compiled with libdnet.<br>
        Compiled against libpcap: 1.9.1                                
        Compiled against libpcap: 1.9.1<br>
        64 bit packet counters: enabled                                
        64 bit packet counters: enabled<br>
        Verbose printing via tcpdump: enabled                          
        Verbose printing via tcpdump: enabled<br>
        Packet editing: enabled                                        
        Packet editing: enabled<br>
        Fragroute engine: disabled                                     
        Fragroute engine: disabled<br>
        Injection method: PF_PACKET send()                             
        Injection method: PF_PACKET send()<br>
        Not compiled with netmap                                       
        Not compiled with netmap<br>
      </font></p>
    <hr width="100%" size="2">
    <p><font face="Courier New, Courier, monospace"><br>
      </font></p>
    <p><font face="Courier New, Courier, monospace">Best regards,</font></p>
    <p><font face="Courier New, Courier, monospace">Steve</font></p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 5/17/2023 9:32 PM, Aaron Turner
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:84E1FFA0-3231-4C0D-8236-692852D8B109@gmail.com">
      <pre class="moz-quote-pre" wrap="">Can’t send packets to the local host. 

-Aaron


</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">On May 17, 2023, at 11:07 AM, Somasekhar K \
<a class="moz-txt-link-rfc2396E" \
href="mailto:soma6610@gmail.com">&lt;soma6610@gmail.com&gt;</a> wrote:


Hi, 
I have a requirement to use tcpreplay in a single Ethernet interface. 
For example if the Ethernet interface name is eth0.
I am now to capture packets via tcpdump
#tcpdump -i eth0 -w data.pcap udp 

However when I use 
# tcpreplay -i eth0 data.pcap 
I am unable to receive the data in socket.. can u kindly provide me solution to this \
problem.. my constraint is I am having single Ethernet interface .

-regards, 
Som




_______________________________________________
Tcpreplay-users mailing list
<a class="moz-txt-link-abbreviated" \
href="mailto:Tcpreplay-users@lists.sourceforge.net">Tcpreplay-users@lists.sourceforge.net</a>
 <a class="moz-txt-link-freetext" \
href="https://lists.sourceforge.net/lists/listinfo/tcpreplay-users">https://lists.sourceforge.net/lists/listinfo/tcpreplay-users</a>
 Support Information: <a class="moz-txt-link-freetext" \
href="http://tcpreplay.synfin.net/trac/wiki/Support">http://tcpreplay.synfin.net/trac/wiki/Support</a>
 </pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">

_______________________________________________
Tcpreplay-users mailing list
<a class="moz-txt-link-abbreviated" \
href="mailto:Tcpreplay-users@lists.sourceforge.net">Tcpreplay-users@lists.sourceforge.net</a>
 <a class="moz-txt-link-freetext" \
href="https://lists.sourceforge.net/lists/listinfo/tcpreplay-users">https://lists.sourceforge.net/lists/listinfo/tcpreplay-users</a>
 Support Information: <a class="moz-txt-link-freetext" \
href="http://tcpreplay.synfin.net/trac/wiki/Support">http://tcpreplay.synfin.net/trac/wiki/Support</a></pre>
  </blockquote>
  </body>
</html>





_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic