Friday 7 November 2014

IP Forwarding (Routing)

Multilayer Switching (MLS)  refers to the process by which a LAN switch, which operates at least at Layer 2, also uses logic and protocols from layers other than Layer 2 to forward data. The term Layer 3 switching  refers specifically to the use of the Layer 3 destination address, compared to the routing table (or equivalent), to make the forwarding decision.

VLAN interfaces give a Layer 3 switch a Layer 3 interface attached to a VLAN. Cisco often refers to these interfaces as  switched virtual interfaces (SVI). To route between VLANs, a switch simply needs a virtual interface attached to each VLAN, and each VLAN interface needs an IP address in the respective subnets used on those VLANs.  Use secondary IP addresses on VLAN interfaces to configure multiple subnets in one VLAN.

For an MLS, an SVI is the  Layer 3 interface that interconnects the internal “router” inside the MLS with the particular VLAN, much like an interface on a real router connects it to a particular network.

Two primary reasons why an MLS might be unable to forward packets into a particular VLAN: Either that VLAN is not created and active on the MLS, or the VLAN exists and is active but there is no physical Layer 2 interface on the switch allowing it to forward frames into that VLAN.

The state of an SVI can be one of the followings
   -Administratively down, line protocol down: The SVI interface is shut down.
   -Down, line protocol down: The corresponding VLAN does not exist, or is not in an active state
   -Up, line protocol down: The corresponding VLAN exists, but it is not allowed and in an STP forwarding state on any Layer 2 switch port (access or trunk).
   -Up, line protocol up:

 To avoid the “up, line protocol down,” at least one of the following conditions must be true:
   -At least one physical trunk that is itself in the “up, line protocol up” state must have this VLAN allowed, not VTP pruned, and in the STP forwarding state.
   -At least one physical switch port that is itself in the “up, line protocol up” state must have this VLAN configured as an access or voice VLAN and in the STP forwarding state.

Using Routed Ports and Port-channels with MLS  

A routed port on an MLS switch has the following characteristics:
   -The interface is not placed into any user-defined VLAN (internally in an MLS switch, an internal usage VLAN  is created for each individual routed port).

The internal usage VLAN created on behalf of a routed port deserves a special mention. For a VLAN-aware MLS, all operations are performed within the context of a VLAN in which the frame or packet is processed. The most natural way for these switches to implement a routed port is in fact to create a hidden, standalone, and dedicated VLAN for each separate routed port, and deactivate the typical Layer 2 control plane protocols on it. These dedicated VLANs are called internal usage VLANs . show vlan internal usage 

Internal usage VLANs are internal to the switch, and regardless of the VTP mode, they are not stored in the VLAN database and are not advertised to any other switch in the VTP domain. Conflicts can cause if an administrator tries to create an extended VLAN whose ID is—unknowingly to the administrator—already used by an internal usage VLAN.

VTPv3 is capable of handling extended VLAN IDs. VTP will fail to create this VLAN on that switch, resulting in connectivity issues. The conflict will be logged only on the switch experiencing the VLAN ID collision and so can elude the administrator’s attention. So, it's generally recommended that if extended VLANs are used, they should be allocated from the end of the extended VLAN range that is opposite to the current internal VLAN allocation policy.

A routed port is a syntactical device in the configuration to make the configuration quick and convenient, while the switch continues to handle the port internally as a switch port with a slightly modified operation.

Ethernet Port-channels can be used as routed interfaces as well. To do so, physical interfaces must be configured with the  no switchport  command  before  adding them to a channel group. The automatically created Port-channel interface inherits the configuration of the first physical interface added to the channel group.

For MLS switches to route using VLAN interfaces, the ip routing global command must be configured.

Policy Routing  

Policy routing (or Policy-Based Routing [PBR]) allows a router to make routing decisions based on information besides the destination IP address. The ip policy or ipv6 policy command tells the IOS to process incoming packets on that interface with different logic before the normal forwarding logic takes place. 

You can have multiple set commands in the same route-map clause. For example, you might want to define the next-hop IP address and mark the packet’s ToS at the same time. The set statements are evaluated in the following order:   
   1. set ip next-hop /set ipv6 next-hop    
   2. set interface    
   3. set ip default next-hop /set ipv6 default next-hop    
   4. set default interface     
The use of set interface and set default interface is strongly recommended only with point-to-point interfaces. 

If PBR is required on a multilayer switch, many lower-end switches, such as Catalyst 3550, 3560, or 3750, require that the TCAM in the switch is repartitioned in a different way, providing TCAM space for PBR entries while taking away space from entries of other types. 

Routing Protocol Changes and Migration    

The steps

1. Planning the Migration Strategy -  If the current IGP is a link-state protocol, it is advisable to perform the migration in a per-area fashion. The backbone routers should be the last ones to migrate.

2. Activating New IGP While Keeping the Current IGP Intact - the new IGP should be activated on the routers in the network, first setting its administrative distance (AD) to a higher value than the current IGP’s AD, and only then adding interfaces and networks to the new IGP and activating selected features. The current IGP is left running and its configuration is unchanged throughout this entire step. If the current IGP uses various ADs for different network types (for example, EIGRP uses 90 and 170 for internal and external routes, respectively), the new IGP’s AD should be reconfigured to be higher than  the highest AD used by the existing IGP.

This way, the new IGP can be deployed across the network, creating adjacencies between routers as usual but not influencing the routing tables and routing just yet. If the current IGP configuration includes redistribution from other sources (static routes, directly connected networks, and so on), the new IGP shall be configured  similarly.If the new IGP is a distance-vector routing protocol (RIP or EIGRP), each router must also be configured with redistribution from the current IGP into the new IGP.

3. Verifying New IGP Adjacencies and Working Database Contents - It is often recommended to verify the contents of the working databases in the new IGP to check whether all expected networks are present, even though not placed into rout-
ing tables because of higher ADs. If the new IGP is a distance-vector protocol, that is, either RIP or EIGRP, these 
protocols advertise a learned route only if it is also installed in the routing table by the same protocol. If the new IGP is RIP or EIGRP, its working databases will  contain only partial contents until the migration starts, making the verification before migration impossible. 

4. Deactivating Current IGP -  The next step in the routing protocol migration involves the actual removal of the current IGP from a contiguous set of routers, one router at a time, allowing the new routing protocol to populate the routing table instead, and then proceeding to the next router. Alternatively, instead of plainly deleting the current IGP configuration from the router, it can be configured using the  passive-interface default  command that will effectively shut it down.
During a properly executed migration, the network consists of a contiguous region that runs both IGPs and of a contiguous region that runs the new IGP only. Traffic crossing the network enters either an unmigrated or a migrated router, and is destined to a network that is directly connected to a router that is again either migrated or unmigrated yet. 

If traffic enters an unmigrated  router and is destined to a network connected to an unmigrated router, the destination network is advertised in both IGPs but the new IGP has been configured with a higher AD, so it has no impact on the routing table contents. 

If traffic enters a  migrated  router and is destined to a network connected to a  migrated router, the destination network is advertised only in the new IGP, as the current IGP has been removed from the destination router. 

If traffic enters an  unmigrated router and is destined to a network connected to a migrated  router, the situation is very similar. As the current IGP has been removed from the destination router, the destination network is advertised only in the new IGP.

Finally, if traffic enters a  migrated  router and is destined to a network connected to an unmigrated router, the situation is slightly more complex. The destination router advertises the network through both IGPs. Other unmigrated routers know the destination network through both IGPs and prefer the current IGP, while migrated routers, including the 
ingress router, know the network through the new IGP only. In the migrated path of the network, the traffic will be routed according to the new IGP until it is forwarded to the first unmigrated router. Starting with this router, all other routers on the path toward the destination  still prefer the path provided by the current IGP.

5. Removing New IGP’s Temporary Settings - After the network has been completely migrated to the new IGP and the previous IGP has been completely removed from all routers, the new IGP still contains temporary settings that were necessary for a seamless migration, especially the modified AD values.
In link-state routing protocols, removing the temporary settings should not cause any additional interruptions in network service. However, in EIGRP, modifying the AD values causes the router to drop and reestablish its  EIGRP adjacencies with neighboring routers, causing a transient disruption in network connectivity. 

Specifics of Distance-Vector Protocols in IGP Migration 

If the new IGP is a distance-vector protocol (such as RIP or EIGRP), a temporary redistribution is inevitable. The reason lies in the advertisement logic of these routing protocols: A learned route will be advertised further only if the router has placed that very learned route into the routing table as well.

Only directly connected networks of its immediate neighbors are learned through EIGRP, and all these networks are marked with a “0 successors, FD is Inaccessible” indication in their heading, preventing them from being advertised further.  

This will cause connectivity outages: R4 will learn only about directly connected networks from R3 through EIGRP, missing all other networks, and R3—still running OSPF—will be unable to forward EIGRP-learned routes from R4 back to R2. 
Clearly, full connectivity in this network will be restored only after OSPF is completely removed.
The solution to this problem is to configure route redistribution from the current IGP into the new IGP on each router in the topology. 

Key observations
Traffic entering a router running both routing protocols and destined to a network on a router running both protocols is routed completely according to the original routing protocol without changes.

Traffic entering a router running the new routing protocol and destined to a network on a router running the new protocol is routed completely according to the new routing protocol. This is because the network in question is not injected into the original routing protocol anymore,

Traffic entering a router running both routing protocols and destined to a network on a router running the new routing protocol is routed completely according to the new routing protocol.

Traffic entering a router running the new routing protocol and destined to a network on a router running both routing protocols will be routed according to the new routing protocol until it hits the first router that still runs both routing protocols. Afterward, it will be routed according to the original routing protocol. 

The last four items are valid if the migration is performed in such a way that the network always consists of at most two contiguous regions. In one, both routing protocols are run (the unmigrated part of network), and in the other, only the new protocol is running (the migrated part of the network). 

No comments:

Post a Comment