Switching

last person joined: yesterday 

Ask questions and share experiences about EX and QFX portfolios and all switching solutions across your data center, campus, and branch locations.
  • 1.  How does EX switch select route with same metrics?

    Posted 09-12-2012 19:07

    Hi,

     

    I got couple of EX4200 and some of them were configred with 2 or 3 static routes:

     

    {master:0}[edit]
    lw# show routing-options
    static {
        route 0.0.0.0/0 next-hop 10.69.27.161;
        route 1.1.3.0/24 next-hop [ 10.69.27.161 10.69.27.162 10.69.27.172 ];
    }
    {master:0}[edit]

     

    I have 3 questions:

     

    1. for the network 1.1.3.0/24 with above configuration, does EX perform load-balancing?

    2. if no, then which route will be choose as next hop? Why?

    3. If I want to perorm load balancing, how to?

     

    Thanks!

     



  • 2.  RE: How does EX switch select route with same metrics?
    Best Answer

    Posted 09-12-2012 22:56

    By default, in the event of equal-cost next-hops Juniper will randomly pick one next-hop per route to install in the forwarding table.
    If you configure "per-packet-load balancing" , then multiple next-hops will be installed in the forwarding table. ( But routing process will show only one next-hop as selected in the routing-table)


    The term "per-packet load balancing"  used by Juniper is not actually the laod-balancing of packets by packets.
    The first generation ASIC's used that kind of load balancing which was not desirable for many reasons.

    The modern day hardware ASICs are capable of load-sharing based on per flow. But still the configuration is called "per-packet" .

    The EX series will do the per flow load-sharing, when you configure "per-packet" policy.

    Check this KB for more information about EX Series.
    http://kb.juniper.net/InfoCenter/index?page=content&id=KB21407&cat=EX_SERIES&actp=LIST

     

    I created the following example in an EX4200 to explain this,

     

    Without "per packet" load-sharing policy configured ,  Per- prefix load-sharing =============================================================

     

    <routing-options>
    static {
        route 10.10.10.0/24 next-hop [ 2.2.2.1 1.1.1.1 ];
        route 20.20.20.0/24 next-hop [ 2.2.2.1 1.1.1.1 ];
    }

     

     


    show route 20.20.20.0/24

    inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both

    20.20.20.0/24      *[Static/5] 00:04:22
                          to 1.1.1.1 via vlan.32
                        > to 2.2.2.1 via vlan.31

     

     show route 10.10.10.0/24

    inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both

    10.10.10.0/24      *[Static/5] 01:40:13
                        > to 1.1.1.1 via vlan.32
                          to 2.2.2.1 via vlan.31

     

     

    show route forwarding-table destination 10.10.10.0/24
    Routing table: default.inet
    Internet:
    Destination        Type RtRef Next hop           Type Index NhRef Netif
    10.10.10.0/24      user     0 1.1.1.1            ucst  1639     5 vlan.32

     

     


    show route forwarding-table destination 20.20.20.0/24
    Routing table: default.inet
    Internet:
    Destination        Type RtRef Next hop           Type Index NhRef Netif
    20.20.20.0/24      user     0 2.2.2.1            ucst  1668     4 vlan.31

     

     

     

     

    With  "per packet" load-sharing policy configured ,,   Per- flow load-sharing .

    =========================================================== 


    <routing-options>

    static {
        route 10.10.10.0/24 next-hop [ 2.2.2.1 1.1.1.1 ];
        route 20.20.20.0/24 next-hop [ 2.2.2.1 1.1.1.1 ];
    }

    forwarding-table {
        export lb-per-packet;
    }

     


    policy-statement lb-per-packet {
        term 1 {
            from {
                route-filter 10.10.10.0/24 orlonger;
                route-filter 20.20.20.0/24 orlonger;
            }
            then {
                load-balance per-packet;
            }
        }
    }

     

     

     


     run show route 20.20.20.0/24

    inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both

    20.20.20.0/24      *[Static/5] 00:00:14
                          to 1.1.1.1 via vlan.32
                        > to 2.2.2.1 via vlan.31

     

     show route 10.10.10.0/24

    inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both

    10.10.10.0/24      *[Static/5] 01:36:38
                        > to 1.1.1.1 via vlan.32
                          to 2.2.2.1 via vlan.31

     

     

    show route forwarding-table destination 20.20.20.0/24
    Routing table: default.inet
    Internet:
    Destination        Type RtRef Next hop           Type Index NhRef Netif
    20.20.20.0/24      user     0                    ulst 131070     3
                                  1.1.1.1            ucst  1639     4 vlan.32
                                  2.2.2.1            ucst  1668     2 vlan.31


    show route forwarding-table destination 10.10.10.0/24
    Routing table: default.inet
    Internet:
    Destination        Type RtRef Next hop           Type Index NhRef Netif
    10.10.10.0/24      user     0                    ulst 131070     3
                                  1.1.1.1            ucst  1639     4 vlan.32
                                  2.2.2.1            ucst  1668     2 vlan.31

     

     

    to answer your questions directly

    1) Yes EX can do load-balancing, by default per prefix / route and next-hop will be chosen randomly for each route.

    2) NA

    3)Depending on your requirment , you can configure per-flow load sharing as mentioned above.

     

    Regards

    Moses N

     

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

    If this post answers your question, please mark it as "Accepted Solution".
    Kudos are a nice way of expressing your gratitude