Tuesday, July 17, 2012

VLAN TRUNKING PROTOCOL - VTP


VLAN TRUNKING PROTOCOL - VTP
Cisco switches use the proprietary VTP to exchange VLAN configuration information between switches. VTP defines a Layer 2 messaging protocol that allows the switches to exchange VLAN configuration information so that the VLAN configuration stays consistent throughout a network. For instance, if you want to use VLAN 3 and name it “accounting,” you can configure that information in one switch, and VTP will distribute that information to the rest of the switches. VTP manages the additions, deletions, and name changes of VLANs across multiple switches, minimizing misconfigurations and configuration inconsistencies that can cause problems, such as duplicate VLAN names or incorrect VLANtype settings.
VTP makes VLAN configuration easier. However, you have not yet seen how to configure VLANs, so to better appreciate VTP, consider this example: If a network has ten interconnected switches, and parts of VLAN 3 were on all ten switches, you would have to enter the same config command on all ten switches to create the VLAN. With VTP, you would create VLAN 3 on one switch, and the other nine switches would learn about VLAN 3 dynamically.
The VTP process begins with VLAN creation on a switch called a VTP server. The changes are distributed as a broadcast throughout the network. Both VTP clients and servers hear the VTP messages and update their configuration based on those messages. So VTP allows switched network solutions to scale to large sizes by reducing the manual configuration needs in the network.
How it works
VTP floods advertisements throughout the VTP domain every 5 minutes, or whenever there is a change in VLAN configuration. The VTP advertisement includes a configuration revision number, VLAN names and numbers, and information about which switches have ports assigned to each VLAN. By configuring the details on one (or more) VTP server and propagating the information through advertisements, all switches know the names and numbers of all VLANs.
One of the most important components of the VTP advertisements is the configuration revision number. Each time a VTP server modifies its VLAN information, it increments the configuration revision number by 1. The VTP server then sends out a VTP advertisement that includes the new configuration revision number. When a switch receives a VTP advertisement with a larger configuration revision number, it updates its VLAN configuration. Fig. 26 illustrates how VTP operates in a switched network.
VTP Process 
Description: fig.26.png.
VTP operates in one of three modes:
·         Server mode
·         Client mode
·         Transparent mode
For VTP to exchange information, some switches act as servers, and some act as clients. VTP servers can create, modify, and delete VLANs and other configuration parameters for the entire VTP domain; this information, in turn, is propagated to the VTP clients and servers in that same domain. VTP servers save VLAN configurations in the Catalyst NVRAM, whereas in clients, the VLAN configuration is not stored at all. A VTP client cannot create, change, or delete VLANs, nor can it save VLAN configurations in nonvolatile memory.
To avoid using VTP to exchange VLAN information in Cisco switches, you use VTP transparent mode. With VTP transparent mode on all switches in a network, VTP is not used. Alternatively, with VTP transparent mode on just some of the switches in a network, VTP servers and clients can work as they normally do, and the VTP transparent mode switches simply ignore the VTP messages. A switch in transparent mode forwards VTP advertisements received from other switches while ignoring the information in the VTP message.
A switch configured in VTP transparent mode can create, delete, and modify VLANs, but the changes are not transmitted to other switches in the domain; they affect only that switch. Choosing to use transparent mode is typical when a network needs to distribute administrative control of the switches. A switch configured in VTP transparent mode can create, delete, and modify VLANs, but the changes are not transmitted to other switches in the domain; they affect only that switch. Choosing to use transparent mode is typical when a network needs to distribute administrative control of the switches.
Function
Server Mode
Client Mode
Transparent Mode
Originates VTP advertisements
Yes
No
No
Processes received advertisements and synchronizes VLAN configuration information with other switches
Yes
Yes
No
Forwards VTP advertisements received in a trunk
Yes
Yes
Yes
Saves VLAN configuration in NVRAM
Yes
No
Yes
Can create, modify, or delete VLANs using configuration commands
Yes
No
Yes
VTP Pruning
By default, a trunk connection carries traffic for all VLANs. Broadcasts (and unknown destination unicasts) in every VLAN are sent to every switch in the network, according to the current STP topology. However, in most networks, a switch does not have interfaces in every VLAN, so the broadcasts for the VLANs in which it has no interfaces simply waste bandwidth. VTP pruning allows switches to prevent broadcasts and unknown unicasts from flowing to switches that do not have any ports in that VLAN. 
VTP pruning increases the available bandwidth by restricting flooded traffic, which consists of broadcasts and unknown destination unicasts. VTP pruning is one of the two most compelling reasons to use VTP. The other reason is to make VLAN configuration easier and more consistent.

Cisco VTP: VLAN Trunking Protocol/H2



Cisco VTP: VLAN Trunking Protocol/H2>
VLAN Trunking Protocol (VTP) is a Cisco Layer 2 messaging protocol that manages the addition, deletion, and renaming of VLANs on a network-wide basis. Virtual Local Area Network (VLAN) Trunk Protocol (VTP) reduces administration in a switched network. When you configure a new VLAN on one VTP server, the VLAN is distributed through all switches in the domain. This reduces the need to configure the same VLAN everywhere. VTP is a Cisco-proprietary protocol that is available on most of the Cisco Catalyst Family products.
VTP ensures that all switches in the VTP domain are aware of all VLANs. There are occasions, however, when VTP can create unnecessary traffic. All unknown unicasts and broadcasts in a VLAN are flooded over the entire VLAN. All switches in the network receive all broadcasts, even in situations where few users are connected in that VLAN. VTP pruning is a feature used to eliminate (or prune) this unnecessary traffic.
By default, all Cisco Catalyst switches are configured to be VTP servers. This is suitable for small-scale networks where the size of the VLAN information is small and easily stored in all switches (in NVRAM). In a large network, a judgment call must be made at some point when the NVRAM storage needed is wasted, because it is duplicated on every switch. At this point, the network administrator should choose a few well-equipped switches and keep them as VTP servers. Everything else participating in VTP can be turned into a client. The number of VTP servers should be chosen so as to provide the degree of redundancy desired in the network.
Modes of Operation
Server
In VTP server mode, you can create, modify, and delete VLANs and specify other configuration parameters (such as VTP version and VTP pruning) for the entire VTP domain. VTP servers advertise their VLAN configuration to other switches in the same VTP domain and synchronize their VLAN configuration with other switches based on advertisements received over trunk links. VTP server is the default mode.
Transparent
VTP transparent switches do not participate in VTP. A VTP transparent switch does not advertise its VLAN configuration and does not synchronize its VLAN configuration based on received advertisements. However, in VTP version 2, transparent switches do forward VTP advertisements that they receive out their trunk ports.
Client
VTP clients behave the same way as VTP servers, but you cannot create, change, or delete VLANs on a VTP client.
Advertisements
Summary Advertisements
When the switch receives a summary advertisement packet, it compares the VTP domain name to its own VTP domain name. If the name is different, the switch simply ignores the packet. If the name is the same, the switch then compares the configuration revision to its own revision. If its own configuration revision is higher or equal, the packet is ignored. If it is lower, an advertisement request is sent.
Subset Advertisements
When you add, delete, or change a VLAN in a switch, the server switch where the changes were made increments the configuration revision and issues a summary advertisement, followed by one or several subset advertisements. A subset advertisement contains a list of VLAN information. If there are several VLANS, more than one subset advertisement may be required in order to advertise them all.
Advertisement Requests
A switch needs a VTP advertisement request in the following situations:
·    The switch has been reset.
·    The VTP domain name has been changed.
·    The switch has received a VTP summary advertisement with a higher configuration revision than its own.
Upon receipt of an advertisement request, a VTP device sends a summary advertisement, followed by one or more subset advertisements.
Configuration
To configure an IOS based switch to be a VTP server, issue the following commands:
SwitchA# vlan database
SwitchA(vlan)# vtp domain vtpdom
SwitchA(vlan)# vtp server
SwitchA(vlan)# exit
These commands configure the switch to be a VTP server in the VTP domain vtpdom. The changes are saved and the revision number is incremented when the exit command is issued.
To configure a VTP client, run the following commands:
SwitchB# vlan database
SwitchB(vlan)# vtp domain vtpdom
SwitchB(vlan)# vtp client
SwitchB(vlan)# exit
To disable VTP, set the vtp mode to transparent as such:
SwitchC# vlan database
SwitchC(vlan)# vtp transparent
SwitchC(vlan)# exit
To monitor the VTP operation and status, use either:
SwitchA# show vtp status

SwitchA# show vtp counters


Router On A Stick Tutorial

Someone asked me about configuring a router on a stick yesterday, so I figured I’d make a short tutorial on it. I haven’t seen this used much in the real world as L3 switches are so common, but it is something I had to learn for the CCNA. Router on a stick is used when for inter-VLAN routing when you have an L2 switch and a router. Here’s the topology:
Description: Router on a stick Topology
Here we have an L2 switch with three VLANs connected to a router. Here’s the config:
Switch
Switch(config)#vlan 5
Switch(config-vlan)#exit
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 15
Switch(config-vlan)#exit
Switch(config)#interface FastEthernet0/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
The switch config is pretty basic, we create VLANs 5, 10 and 15, then we make a trunk port to the router.
Router
Router(config)#interface FastEthernet0/0
Router(config-if)#no ip address
Router(config-if)#interface FastEthernet0/0.5
Router(config-subif)#encapsulation dot1Q 5
Router(config-subif)#ip add 192.168.5.1 255.255.255.0
Router(config-subif)#interface FastEthernet0/0.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip add 192.168.10.1 255.255.255.0
Router(config-subif)#interface FastEthernet0/0.15
Router(config-subif)#encapsulation dot1Q 15
Router(config-subif)#ip add 192.168.15.1 255.255.255.0
On the router, we go to the interface connected to the switch and make sure there is no IP address. Then we configure our subinterfaces with 802.1q and the appropriate VLAN. Then we give each subinterface an IP address. Now we can see all the subinterfaces are up:
Router#sh ip int b
Interface              IP-Address      OK? Method Status  Protocol
FastEthernet0/0        unassigned      YES NVRAM  up      up
FastEthernet0/0.5      192.168.5.1     YES manual up      up
FastEthernet0/0.10     192.168.10.1    YES manual up      up
FastEthernet0/0.15     192.168.15.1    YES manual up      up
Now we’ll verify connectivity by pinging the subinterfaces from the switch:
Switch#ping 192.168.5.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.5.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
 
Switch#ping 192.168.10.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
 
Switch#ping 192.168.15.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.15.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
That’s it, we have a working router on a stick. Pretty simple configuration.


OTHER

Cisco switch: 802.1q trunk to router, aka router-on-a-stick

Contributor Icon Contributed by Al Banks Date Icon November 17, 2006  
Tag Icon Tagged: Cisco switch  

Connect a Cisco switch and router via 802.1q trunking. This configuration is known as a router-on-a-stick.


First, let’s start with the switch. VLAN 1 exists by default, so we’ll add a couple of other VLANs:
vlan 100
name data
state active
vlan 200
name data
state active
Now, let’s configure the switchport to connect to the router:
interface fastethernet 1/0/1
switchport trunk encapsulation dot1q
switchport mode trunk
Over to the router!
interface fastethernet 0/0
no ip address
interface fastethernet 0/0.1
encapsulation dot1q 1 native
interface fastethernet 0/0.100
encapsulation dot1q 100
ip address 192.168.100.1 255.255.255.0
interface fastethernet 0/0.200
encapsulation dot1q 200
ip address 192.168.200.1 255.255.255.0
At this point, workstations on VLAN 100 should be able to ping the 192.168.100.1 address, and workstations on VLAN 200 should be able to ping the 192.168.200.1 address.
If, for some reason, the native VLAN on the switchport is something other than 1, change the encapsulation statement on the router, or the trunk may not form.

What is MultiLayer Switching


What is MultiLayer Switching?
MultiLayer Switching (MLS) is where a Layer 2 switch blade does Layer 3 (or pseudo-Layer 3) forwarding of packets between subnets. You can find out about this in the recent documentation by looking for Layer 3 Switching Guides under the 5000 or 6000 models.
The particular form of Layer 3 switching (hardware-assisted routing) we'll be looking at is implemented with the Netflow Feature Card (NFFC) functionality in Catalyst 5000 series switches. This requires that you have either the Supervisor III engine with NFFC  daughter-board, or the Supervisor IIG or IIIG card (no daughter-board required). It also requires that you have either a suitable external router or the internal Route-Switch Module (RSM) blade (or Route-Switch Feature Card -- RSFC -- with the Sup IIG or IIIG blade). Suitable external routers are those implementing the router component of MultiLayer Switching, which is now all the models of larger size / more capability, equipped with an IOS image that is MLS-capable. The online documentation specifies that this is the Cisco 7500, 7200, 4700, 4500, or 3600 series router with an IOS image that supports IP MLS. (IPX MLS is also available, but of less general interest. Ditto, IP multicast MLS).
The MLS functionality is also supported (with greater simplicity, and fewer configuration options) in the 6000 series!
To understand what's going on, let's first talk through what happens when a packet is forwarded by a router. There's lots that goes on in addition to what follows, but let's not muddle things with unrelated detail. These steps are the ones we're interested in:
  • router interface hardware receives the bits and checks the checksum
  • router strips off the Layer 2 header (de-encapsulates the packet)
  • router determines outbound interface and next hop IP address from routing table
  • router builds new Layer 2 header
  • new Layer 2 header and payload are assembled and queued for the outbound interface
  • outbound interface sends out the packet, tacking on FCS checksum at end
If you're really into switching performance, you understand that the routers cache the outbound interface and new Layer 2 header information. And the routing table lookup is preceded by cache lookup(s), possibly hardware-assisted and distributed to the interface cards, to get the packet out of the box as fast as possible, with as little central CPU involvement as possible. Let's not go into the details of this, since that's probably a whole article in itself.
The key operation that is needed to understand MLS is the de-encapsulation / re-encapsulation. The router strips off the old Layer 2 header, slaps on the new one, and queues the packet for transmission. The Layer 2 headers are per-hop (from router to router across a subnet). The MAC addresses in those Layer 2 headers are per-hop, local to the Layer 2 segment (broadcast domain; VLAN). IP addresses in the Layer 3 IP header are end to end: the ultimate sender and recipient.
In doing MLS, a NFFC switch blade (or Supervisor IIG / IIIG with built-in comparable functionality) is doing the job of emulating the router, without actually sending the packets to the router. In order to simulate a router transparently, the NFFC has to de-encapsulate and re-encapsulate the packet, and also re-calculate the Layer 2 checksum (FCS).
A requirement for the MLS functionality to work is that you enable it in both the participating router and switch components. (With the 6000, MLS on the switch is enabled by default, and is only disabled when you disable MLS on the switch router component, the MSM or MSFC). Furthermore, MLS only applies to packets where the switch is in position to observe the packet before and after it passes through the router. See the figure below.
My analogy for MLS is a manager with a smart assistant. The manager and assistant agree that certain responsibilities are delegated to the assistant. When the assistant observes how the manager handles certain tasks, the assistant will step in and imitate the manager's previous decision(s). The manager agrees to this, and will let the assistant know when the policy changes.
Description: http://www.netcraftsmen.net/images/stories/welcher/fig9911a.gif
In the case of MLS, the router is the manager, with packet switching at Layer 3 being delegated to the switch. When a packet passes through the switch, the switch snoops (in effect) to see what the router does with the packet. As it comes back through the switch (post-router, after de-encapsulation and re-encapsulation), the switch learns the new Layer 2 header. When subsequent packets reach the switch bound for the same IP destination, the switch can then just imitate the router, by replacing the Layer 2 header with the cached (stored) Layer 2 header, just as the router previously did. If routing changes, the router does need to notify the switch, which flushes the cached Layer 2 header, since a new routing policy is now in effect.
I hope you're wondering, "but switches make forwarding decisions based on MAC addresses". True! When does a router get involved in forwarding packets? When they are headed for a different subnet. Within the same subnet, MAC address is all that is relevant. That's where switches forward -- within the same VLAN. But when a PC or host computer is sending to another subnet, it does something differently. The destination MAC address is no longer that of the destination computer. It is instead the MAC address of the default gateway router interface.
This is another function of enabling MLS in the router. It can in effect tell the switch (or we can configure into the switch) the MAC address of the router. The switch needs to know that the router's MAC address is special. The frames sent to that MAC address are the frames where the switch needs to subsequently snoop to "observe" the router's imposition of a new Layer 2 header!
Let's re-visit this in more detail now.
Details of MLS Activity in a Switch
When MLS is configured (enabled) in a router (the MLS Route Processor, or MLS-RP), the MLS-RP sends out a multicast announcement that it is doing MLS. The multicast address is the CGMP well-known address, 01-00-0c-dd-dd-dd. This multicast should pass transparently through non-Cisco switches, and tells MLS-capable switches to learn the router's MAC address. The MAC address is internally associated with a one byte XTAG, an internal identifier for fast lookup.
Now suppose a host or PC attached to the MLS switch sends a packet destined for a different subnet. Assuming that the MLS-RP is also the PC's default gateway, the switch observes that the router's MAC address is the destination of the Layer 2 frame. Since the router is a MLS-RP, the switch checks its cache, to see if it already knows what to do for packets from that flow (we'll talk about flows later). If there is a cache entry, the switch replaces the Layer 2 header, then uses normal switching procedures to deliver the frame (Layer 2 destination MAC lookup and forwarding).
If there is no cache entry, the switch creates a temporary cache entry, a place holder for when the post-router frame is seen. (A candidate cache entry). The switch forwards the frame to the router. The router does its thing. The frame comes back to the switch (different VLAN, same switch). The switch sees the candidate entry, records the Layer 2 header in the cache. And forwards the frame.
Subsequently, packets from the same flow have Layer 2 headers rewritten (and checksums recalculated and rewritten) by the switch hardware, and are forwarded without actually having gone through the router.
Should a router get disconnected from the switch, the XTAG provides a fast way for the switch to invalidate entries learned from a particular router.
Configuring Routing Between VLAN's
External Router
If you're routing between VLAN's on a switch with an external router, you are either trunking (see earlier article) or you are not. If you're not trunking, each router interface is a separate subnet,  and the router is configured just as usual for IP subnets, on the main interfaces. If you are trunking, then you need to configure the router accordingly, using subinterface. This will look something like the following:
interface fastethernet 0/0 
no ip address
interface fastethernet 0/0.100 
encapsulation isl 100 
ip address 172.16.1.1 255.255.255.0
interface fastethernet 0/1.105 
encapsulation isl 105 
ip address 172.16.5.1 255.255.255.0
Note that we've made the subinterface (101 or 105) match the VLAN number in the encapsulation isl (or dot1q) statement. This convention means not having to track which subinterface goes with which VLAN. A best practice!
The "encapsulation isl" and the subinterfaces is your clue that this router thinks the FastEthernet is a trunk and that it is doing ISL VLAN's.
Internal Router (RSM/RSFC/MSM/MSFC)
Internal routers in Catalyst switches think their interfaces have names like "interface vlan 1". So the above example becomes merely:
interface vlan 100 
ip address 172.16.1.1 255.255.255.0
interface vlan 105 
ip address 172.16.5.1 255.255.255.0
Referring to the above figure, the trunk in the picture is now instead the internal backplane of the switch. Both the router and switch components are inside the chassis.
Configuring MultiLayer Switching
Configuring MLS has two components: configuring the router (external or RSM/RSFC blade), and configuring the switch (Supervisor blade). We'll talk about each of these in turn. The following are for a Catalyst 5000.
External Router
You need to globally enable MLS with:
mls rp ip
If the switch has a VTP domain, the MLS physical (primary) interface must agree:
interface fastethernet 0/0 
mls rp vtp-domain domain-name
You then enable MLS per interface:
interface fastethernet 0/0.100 
mls rp ip
You also need one interface which is connected to the switch set up as the MLS management interface:
interface fastethernet 0/0.100 
mls rp management-interface
If the external router has only non-trunk links to the switch, you need to configure an associated VLAN id with each:
interface ethernet 0 
mls rp vlan-id 100
(With trunk interfaces, the ISL or 802.1q tag provides VLAN info, needed in the MLS-RP hello).
Internal Router (RSM/RSFC/MSM/MSFC)
With internal routers, basically just the interface names change (and you can omit the vlan-id, since it is implicit with each interface).
mls rp ip
interface vlan 100 
mls rp vtp-domain domain-name 
mls rp ip
interface vlan 105 
mls rp ip 
mls rp management-interface
Supervisor
MLS is enabled by default on MLS-capable switches. If disabled, re-enable it on a Catalyst 5000 with the command:
set mls enable
With an external router, you need to tell the switch the router's IP address:
set mls include ip-address
(where ip-address is the address shown on the router with the " show mls rp" command). 

Catalyst 6000 MSFC
The only important thing you can configure with Catalyst 6000's is MLS on an interface. It defaults to "on" on the MLS-RP, and cannot be globally disabled (except perhaps by disabling it on all interfaces?). The MLS-SP defaults to "on", and is apparently only disabled if MLS is off on all MSFC interfaces. Sample of how to turn MLS off on an interface:
interface vlan 100 
no mls ip
But What Is a Flow?
A flow might be all packets for a certain IP address. Or it might be packets between an IP source and destination. Or it might be packets between a certain IP source and destination on a single port. The meaning varies here because the switch caches based on flows, and it only caches what it has to. With normal routing, only destination matters. Throw in a standard IP access list on the MLS-RP, and suddenly source address matters. So in such situations, the MLS-SP (switch) caches based on source-destination IP pairs. Throw in an extended IP access list and transport protocol and destination port makes a difference. So then the switch caches based on source-destination-transport protocol-port information. The fancy name for this is "flow masks", which are respectively destination-ip, source-destination-ip, and ip-flow in the Cisco documentation.
If you want, you can configure the switch to force it to cache more specifically. This may impact performance, and would be a fairly odd thing to configure. For instance, with no access lists on the router component, you could configure the switch component to force at least source-destination-ip mask:
set mls flow destination-source
The other keyword options for minimal flow mask are destination and full, corresponding to destination-ip and ip-flow above.
Wrap Up
We're out of space, so I'm going to tell you that the relevant show commands mostly start with "show mls". Knowing that, you can use the help system to figure out what's available. And if you try this out, I hope and trust the output will make good sense.
There is also a "clear mls" command (or set of commands).
You can configure cache aging time, which is how long an idle period between packets before a cache entry ages out. You can also tweak the fast aging time, which is the length of time a new entry stays in the cache if the configured switch packet threshold isn't passed. (The idea is to conserve resources by using cache entries for flows with many packets. Those with few packets fail to meet the packet threshold and so their cache entry gets dropped more quickly).
There are also a number of fine points to MLS behavior, some caveats (warnings), and some situations where MLS becomes disabled. For details on all these, see the documentation.
I'm still considering doing an article on switched network design. See you in a month!