Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sat Aug 19, 2017 2:44 am


Internet Protocol, Transport Control Protocol, Network protocols, Routing, Routers, IP aliases, Routes, Ethernet

Author Message
mandrei99
Post  Post subject: FreeBSD + IPerf send multicast source traffic via specific interface  |  Posted: Mon Jul 22, 2013 10:26 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
 

FreeBSD + IPerf send multicast source traffic via specific interface

When generating multicast traffic under FreeBSD, Iperf will send all the traffic via the interface for the default route, even though "-B" switch is used to bind to the source IP of a different interface.

In this senario, I have two interfaces: vlan10 and vlan120. Default route goes out via vlan10 interface, but I need to send multicast traffic out the vlan120 interface.
Code:
[root@thor ~]# route get default
   route to: default
destination: default
       mask: default
    gateway: apollo-vl10.ivorde.ro
  interface: vlan10
      flags: <UP,GATEWAY,DONE,STATIC>
recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0
[root@thor ~]# route get 239.1.1.1
   route to: 239.1.1.1
destination: default
       mask: default
    gateway: apollo-vl10.ivorde.ro
  interface: vlan10
      flags: <UP,GATEWAY,DONE,STATIC>
recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0
[root@thor ~]# ifconfig vlan120
vlan120: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:07:e9:a5:9b:fa
        inet 10.1.120.2 netmask 0xffffff00 broadcast 10.1.120.255
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active
        vlan: 120 parent interface: em0
[root@thor ~]# iperf -c 239.1.1.1 -u -T 64 -i 10 -t 10000 -B 10.1.120.2


On Linux, iperf would send the traffic out via vlan120 interface because of the '-B' argument. Iperf quote:
Quote:
-B, --bind <host>
bind to <host>, an interface or multicast address


In my case, "systat -if 1" shows that the multicast traffic still goes out via the default gateway interface: vlan10:
Code:
         vlan10  in      0.108 KB/s          0.195 KB/s          789.687 MB
                 out   131.372 KB/s        133.568 KB/s          110.491 MB


The hack is to add a route for the multicast group /32 via a gateway in the 10.1.120.0/24 subnet. Without interrupting the iperf multicast stream, I do exactly that and check systat again:
Code:
# route add 239.1.1.1/32 10.1.120.4
add net 239.1.1.1: gateway 10.1.120.4
# systat -if 1   
                    /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
     Load Average

      Interface           Traffic               Peak                Total
        vlan120  in      0.000 KB/s          0.065 KB/s          203.151 KB
                 out   130.908 KB/s        132.381 KB/s            1.793 GB
         vlan10  in      0.196 KB/s          0.309 KB/s          789.706 MB
                 out     0.387 KB/s          1.551 KB/s          118.021 MB


When the route for the multicast group 239.1.1.1 is added on the subnet where the interface vlan120 is connected, the kernel will chose that interface to send multicast traffic through.

From my tests, I can see that the Iperf behavior on Linux is different in that iperf will choose the interface having the ip address in the "-B" argument.





Top
admin
Post  Post subject: Re: FreeBSD + IPerf send multicast source traffic via specific interface  |  Posted: Fri Nov 29, 2013 4:09 pm
Site Admin

Joined: Mon Aug 03, 2009 8:43 am
Posts: 95

Offline
use
Code:
iperf -c 239.0.0.1 -u -T 64 -i 10 -t 10000 -B 10.1.20.2 -l 1400
to set the UDP datagram size to 1400 bytes (avoid fragmentation in some cases)

_________________
VPSie - SSD VPS servers in AMS-IX, LINX, DE-CIX
https://vpsie.com


Top
waleed111
Post  Post subject: Re: FreeBSD + IPerf send multicast source traffic via specific interface  |  Posted: Mon Mar 09, 2015 1:29 am

Joined: Mon Mar 09, 2015 1:14 am
Posts: 1

Offline
The hack is to add a route for the multicast group /32 via a gateway in the 10.1.120.0/24 subnet. Without interrupting the iperf multicast stream, I do exactly that and check systat again:

_________________
www.solitairecardgame.info


Top
areeba
Post  Post subject: Re: FreeBSD + IPerf send multicast source traffic via specific interface  |  Posted: Sat Apr 11, 2015 5:28 am

Joined: Sat Apr 11, 2015 5:23 am
Posts: 1

Offline
Ok thanks

_________________
areeba


Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "FreeBSD + IPerf send multicast source traffic via specific interface"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. FreeBSD + IPERF sending IGMP v2 multicast group join / leave via specific interface

mandrei99

0

3252

Mon Jul 22, 2013 10:41 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD list interface multicast group membership

mandrei99

0

1566

Tue Dec 03, 2013 9:02 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD list the outgoing interface for packets to a specific IP destination

mandrei99

0

755

Mon Jul 22, 2013 10:12 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux list the outgoing interface for packets to a specific IP destination

mandrei99

0

927

Mon Jul 22, 2013 10:17 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD tcpdump on enc0 doesn't show any traffic

mandrei99

0

1421

Fri Jun 21, 2013 8:54 am

mandrei99 View the latest post

There are no new unread posts for this topic. "OSPF not enabled on this interface" FreeBSD Quagga ospfd interface status

debuser

1

2379

Thu Apr 01, 2010 5:55 am

debuser View the latest post

There are no new unread posts for this topic. Sendip packet crafting tool: How to send bad checksum TCP packets

mandrei99

2

1555

Wed Apr 15, 2015 2:02 am

lizamare View the latest post

There are no new unread posts for this topic. FreeBSD show network interface statistics

mandrei99

0

2150

Wed Sep 25, 2013 9:30 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to accept IPv6 Router Advertisements on interface in FreeBSD

mandrei99

0

1082

Wed Apr 29, 2015 3:54 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux How to change hardware MAC address of an interface

debuser

1

884

Tue Dec 06, 2011 6:26 am

Zettie49 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO