Showing posts with label Introduction. Show all posts
Showing posts with label Introduction. Show all posts

Friday, November 13, 2009

Multilayer Switching

This next section walks through the switching process and focuses on order of operations. The order things happen is extremely important for two reasons. First, order of events is good test material. Second, understanding the processing order allows you to evaluate how the various filtering and forwarding mechanisms interact (examples include error checking, access-lists, VLAN access-lists, routing, and QoS).


Understanding the Switching Process

Steps involved in layer 2 forwarding are as follows:
  • Input
1. Receive frame.
2. Verify frame integrity.
3. Apply inbound VLAN ACL (Virtual Local Area Network
Access List).
4. Look up destination MAC (Media Address Code).

  • Output
1. Apply outbound VLAN ACL.
2. Apply outbound QoS ACL.
3. Select output port.
4. Queue on port.


Steps involved in layer 3 forwarding are as follows:

  • Input
1. Receive frame.
2. Verify frame integrity.
3. Apply inbound VLAN ACL.
4. Look up destination MAC.

  • Routing
1. Input ACL.
2. Switch if entry cached.
3. Identify exit interface and next-hop address using routing table.
4. Output ACL.

  • Output
1. Apply outbound VLAN ACL.
2. Apply outbound QoS ACL.
3. Select output port.
4. Queue on port.
5. Rewrite source and destination MAC, IP checksum and frame check sequence, and decrement TTL (Time to Live field in the IP header).
6. Forward.


Understanding the Switching Table

Content Addressable Memory (CAM) is used for MAC tables for layer two switching.

  • Used for Catalyst 4500 layer 2 forwarding tables
  • Used for Catalyst 6500 layer 2 and Netflow forwarding tables
  • Contains binary values (0 or 1)
  • Match must be exact

In comparison, MLS uses Ternary Content Addressable Memory (TCAM).

  • Used for Catalyst 3500/3700, 4500, and 6500 layer 3 switching
  • Ternary (3) values (0, 1, or wildcard)
  • Entries are in VMR form
—Value—Pattern to be matched.
—Mask—Masking bits associated with pattern.
—Result—Consequences of a match (permit/deny or more complex information).


Understanding Switch Forwarding Architectures

In a Centralized Forwarding model, the CPU controls forwarding decisions:
  • Decision made by single table
  • Used by 4500 and 6500

With Distributed Forwarding, the forwarding decisions are spread throughout the interface ASICs:
  • Decision made at port or module
  • Used by 3500/3700 and 6500 with distributed forwarding card
  • NetFlow switching
  • Decision made cooperatively by Route Processor and MLS
  • First packet switched in software, result cached
  • Subsequent packets switched in hardware

Cisco Express Forwarding (CEF) uses a different kind of memory to facilitate forwarding:
  • Uses TCAM
  • Topology-based switching (via Forwarding Information Base [FIB])
  • Can be centralized or distributed

Sunday, June 14, 2009

Multicast MAC Address

Multicast MAC addresses all start with the first 25 bits 01005E. The last 23 bits are the left-most bits from the IP address. Example 7-4 shows how a MAC address of 0100.5E40.0305 maps to a multicast IP address of 227.64.3.5.


The first four bits of multicast IP addresses are always 1110, and the last 23 bits map to the MAC. That leaves five bits that are dropped. Remember that this is an issue, because every multicast MAC maps to many multicast IPs! Example 7-5 shows how a MAC address of 0100.5E40.0305 could map to several different multicast IP addresses. Notice that the first two octets can vary in the IP addresses.


Multicast IP Addresses

Multicasts use the IP address range 224.0.0.0 to 239.255.255.255. The first four bits of the first octet are always binary 1110, and the remaining 28 bits identify the multicast group. Some addresses are reserved:
  • 224.0.0.1 is the all-hosts group.
  • 224.0.0.2 is the all-routers group.
  • The rest of the 224.0.0.0/24 range is reserved for link-local protocols.
  • 224.0.1.0 to 238.255.255.255 are for use over the Internet, and they are called globally-scoped addresses.
  • Source-specific multicast uses 232.0.0.0/8 addresses.
  • 233.0.0.0/8 is used to assign static multicast addresses for use by an organization. The second and third octets of the address are the organization’s Autonomous System number. This is called GLOP, which is a combination of global and scope.
  • 239.0.0.0/8 is for local use within an organization, and it is called a limited scope or an administratively scoped address.

Protocol Independent Multicast (PIM)

PIM is a protocol used between routers to keep track of where to forward traffic for each multicast group. It can use information gathered from any routing protocol. PIM can run in dense mode or sparse mode.

PIM Dense Mode
PIM dense mode uses source-based trees. When running in dense mode, PIM assumes that every router needs to receive multicasts. Any router that doesn’t want to receive it must send a prune message upstream to the server. PIM dense mode is most appropriate when:
  • Multicast servers and receivers are near each other.
  • There are just a few servers and many receivers.
  • You have a high volume of multicast traffic.
  • The multicast stream is fairly constant.
PIM Sparse Mode
PIM sparse mode uses shared distribution trees. It does not assume that any routers want to receive the multicast, but instead waits to hear an explicit message from them, joining the group. Then it adds branches to the tree to reach the hosts behind those routers. PIM sparse mode uses RPs to connect hosts and servers. After the connection is made, PIM switches over to a source tree. Sparse mode is used when:
  • Pockets of users are widely dispersed around the network.
  • Multicast traffic is intermittent.
PIM Sparse-Dense Mode
An interface can be configured in sparse-dense mode. Then, if the router knows of an RP for its group, it uses sparse mode. Otherwise, it uses dense mode. In addition, it makes the interface capable of receiving multicasts from both sparse and dense-mode groups.


Configuring Multicast Routing and PIM

Use the following command to enable multicast routing:

(config)# ip multicast-routing

PIM mode must be configured at each interface with the following command. Configuring PIM on an interface also enables Internet Group Management Protocol (IGMP) on that interface:

(config-if)# ip pim {sparse-mode | dense-mode | sparse-dense-mode}

When using sparse mode, an RP must be specified. A router knows that it is an RP when it sees its own address in the command:

(config)# ip pim rp-address ip-address


Auto-RP
Auto-RP automates the discovery of RPs in a sparse or sparse-dense PIM network. RPs advertise themselves to a router designated as an RP mapping agent. The mapping agent then decides on one RP per group and sends that information to the other routers.

To configure a router as an RP, type the following:

(config)# ip pim send-rp-announce type number scope ttl group-list access-list-number

To configure a router as a mapping agent, type the following:

(config)# ip pim send-rp-discovery scope ttl


PIM Version 2
Cisco routers with recent versions of the IOS use PIM Version 2 by default. Some differences between PIM Version 1 and PIM Version 2 include:
  • PIM Version 1 is Cisco proprietary, whereas PIM Version 2 is standards-based.
  • Both versions can dynamically map RPs to multicast groups. PIM Version 1 uses an auto-RP mapping agent, and PIM Version 2 uses a bootstrap router (BSR).
  • PIM Version 1 uses a Time-to-Live value to bound its announcements, and PIM Version 2 uses a configured domain border.
  • In PIM Version 2, sparse and dense mode are group properties, not interface properties.

To configure PIM Version 2, configure at least one router as a BSR, and selected routers as RPs. To configure a BSR, use the following:

(config)# ip pim bsr-candidate interface hash-mask-length [priority]

To configure a router as a candidate RP, use the following:

(config)# ip pim rp-candidate type number ttl group-list access-list-number

Monday, May 11, 2009

Tools for Controlling/Preventing Routing Updates

Cisco IOS provides several ways to control routing updates. They include:
  • Passive interface
  • Default and/or static routes
  • Distribute list
  • Route map
  • Change administrative distance

Passive Interface
The passive-interface command prevents routing updates from being sent out an interface that runs the routing protocol. RIP and IGRP do not send updates out an interface. It prevents other routing protocols from sending hellos out of an interface; thus, they don’t discover neighbors or form an adjacency out that interface. To disable the protocol on one interface, use the command passive-interface interface. To turn off the protocol on all interfaces, use passive-interface default. You can then use no passive-interface interface for the ones that should run the protocol, as shown:

Router(config)#router eigrp 7
Router(config-router)#passive-interface default
Router(config-router)#no passive-interface s0/0/0


Distribute Lists
A distribute list allows you to filter routing updates and also routes being redistributed through an access list. Configure an access list that permits the routes to be advertised or redistributed, and then link that access list to the routing process with the distribute-list command, given under router configuration mode. This command has two options:
  • distribute-list access-list in—Filters updates as they come in an interface. For OSPF, this controls routes placed in the routing table but not the database. For other protocols, this controls the routes the protocol knows about.
  • distribute-list access-list out—Filters updates going out of an interface and also updates being redistributed out of another routing protocol into this one.

Route Maps
Route maps are a bit like programs that use a “if/then/else” decisionmaking capability. They match traffic against certain conditions, and then set specified options for that traffic. Each statement has a sequence number, statements are read from the lowest number to highest, and the router stops reading when it gets a match. The sequence number can be used to insert or delete statements. Like an access list, there is an implicit “deny” at the end of each route map; any traffic not matched with a route map statement is denied. Some uses for route maps include:
  • Filtering redistributed routes—Use the route-map keyword in the redistribute command.
  • Policy-based routing—To specify which traffic should be policy routed, based on very granular controls.
  • BGP policy—To control routing updates and to manipulate path attributes.

Route Map Syntax
Route maps are created with the global command:

Router(config)#route-map {tag} permit | deny [sequence_number]

Each statement in a route map begins this same way, with the same route map name but different sequence numbers, and with match and/or set conditions below it. Permit means that any traffic matching the match conditions is used. Deny means that any traffic matching the match conditions is not used.


Match and Set Conditions
Each route map statement can have from none to multiple match and set conditions. If no match condition exists, the statement matches anything, similar to a “permit any” in an access list. If there is no set condition, the matching traffic is either permitted or denied, with no other conditions being set.

Multiple match conditions on the same line use a logical OR. For example, the router interprets match a b c as “match a or b or c.” Multiple match conditions on different lines use a logical AND. For example, the router interprets the following route map
statement as “match a and b and c:”

route-map Logical-AND permit 10
match a
match b
match c

In route redistribution, some common conditions to match include:
  • ip address—Refers the router to an access list that permits or denies networks.
  • ip next-hop—Refers the router to an access list that permits or denies next-hop IP addresses.
  • ip route-source—Refers the router to an access list that permits or denies advertising router IP addresses.
  • metric—Permits or denies routes with the specified metric from being redistributed.
  • route-type—Permits or denies redistribution of the route type listed, such as internal or external.
  • tag—Routes can be labeled (tagged) with a number, and route maps can look for that number.
In route redistribution, some common conditions to set are:
  • metric—Sets the metric for redistributed routes.
  • metric-type—Sets the type, such as E1 for OSPF.
  • tag—Tags a route with a number that can be matched on later by other route maps.
  • level—For IS-IS, sets the IS level for this route.

The following configuration example shows a route map named BGPLP with three statements that are used to control which routes will be redistributed from OSPF into BGP. The router has already been configured with two access lists, numbered 23 and 103 (not shown.) The first route map statement, with sequence number 10, is a permit statement. The match condition tells it to use access list 23. Any traffic permitted by access list 23 matches this statement and will be redistributed into BGP. Any traffic explicitly denied by access list 23 will not be redistributed into BGP. The set condition tells it to set a BGP local preference for all traffic that matches statement 10. Traffic not matching access list 23 will be checked against the second route map statement.

The second route map statement, sequence number 20, is a deny statement that matches access list 103. Any traffic permitted by access list 103 will be denied by this statement, and thus will not be redistributed. Any traffic explicitly denied by access list 103 will be ignored by this statement, and checked against the next route map statement. This route map statement has no set conditions. Traffic not matching route map statements 10 or 20 will be checked against statement 30.

The third route map statement, sequence number 30, is a permit statement with no match or set conditions. This statement matches everything and sets nothing, thus permitting all other traffic without changing it. Without this statement, all other traffic would be denied.

Lastly, the route map is applied to the redistribution command, to filter routes redistributed from OSPF into BGP.

Router(config)#route-map BGP-LP permit 10
Router(config-route-map)#match ip address 23
Router(config-route-map)#set local-preference 200
Router(config-route-map)#!
Router(config-route-map)#route-map BGP-LP deny 20
Router(config-route-map)#match ip address 103
Router(config-route-map)#!
Router(config-route-map)#route-map BGP-LP permit 30
!
Router(config)#router bgp 65001
Router(config-router)#redistribute ospf 1 route-map BGP-LP


Manipulating Administrative Distance
When a router receives routes to the same destination network from more than one routing process, it decides which to put in the routing table by looking at the administrative distance (AD) value assigned to the routing process. The route with the lowest AD is chosen. Table 5-2 shows administrative distance values.


AD can be changed for all routes of a process or only for specific routes within a process. The command for all IGPs except EIGRP is:

Router(config-router)#distance administrative_distance {address wildcard-mask} [access-list-number | name]

Using the address/mask keywords in the command changes the AD of routes learned from the neighbor with that IP address. An entry of 0.0.0.0 255.255.255.255 changes the AD of all routes. Specifying an access list number or name changes the AD only on networks permitted in the ACL.

EIGRP and BGP have different AD values for internal and external routes, so you have to list those separately when using the command with those protocols. BGP also allows you to change the AD for locally generated routes. For these protocols, the commands are:

Router(config-router)#distance eigrp internal-distance externaldistance
Router(config-router)#distance bgp external-distance internaldistance local-distance

Route redistribution can cause suboptimal routing; one way to correct this is to adjust AD. Figure 5-1 shows a network with two routing domains: RIP and OSPF.

R2 redistributes its RIP routes into OSPF. These routes inherit OSPF’s AD when they are advertised to R4. R4 then advertises them to R3 as OSPF routes.

R3 now knows about the 10.1.1.0 network from two routing processes: RIP, with an AD of 120, and OSPF, with an AD of 110. The shortest path is the RIP route through R1. The OSPF path goes through R4 and R2, and then to R1—a much longer path. But, based on AD, R3 puts the OSPF path in its routing table.

To prevent this, increase the AD of the redistributed RIP routes when OSPF advertises them. Note that this doesn’t change all OSPF routes, just the ones learned from RIP. The commands given on R2 (the router doing the initial redistribution) are shown in the
following:

Router(config)#access-list 10 permit 10.1.1.0
!
Router(config)#router ospf 1
Router(config-router)#redistribute rip subnets
Router(config-router)#distance 125 0.0.0.0 255.255.255.255 10


The AD is increased to 125 for routes from all neighbors, if they match the network permitted in access list 10. Now R3 hears about the 10.1.1.0 network from RIP with an AD of 120, and from OSPF with an AD of 125. The RIP route is put into the routing table based on its lower AD.

Sunday, May 3, 2009

Optimizing Routing

There are times when you need to go beyond just turning on a routing protocol in your network. You may need to use multiple protocols, control exactly which routes are advertised or redistributed, or which paths are chosen. Most networks use DHCP; your router may need to be a DHCP server, or relay DHCP broadcasts.

Using Multiple Routing Protocols
There are several reasons you may need to run multiple routing protocols in your network. Some include:
  • Migrating from one routing protocol to another, where both protocols will run in the network temporarily
  • Applications that run under certain routing protocols but not others
  • Areas of the network under different administrative control (“layer 8” issues)
  • A multi-vendor environment in which some parts of the network require a standards-based protocol

Configuring Route Redistribution

If routing information must be exchanged among the different protocols or routing domains, redistribution can be used. Only routes that are in the routing table and learned via the specified protocol are redistributed. Each protocol has some unique characteristics when redistributing, as shown in Table 5-1.


You can redistribute only between protocols that use the same protocol stack, such as IP protocols, which cannot advertise IPX routes. To configure redistribution, issue this command under the routing process that is to receive the new routes:

Router(config-router)#redistribute {route-source} [metric metric] [route-map tag]


Seed Metric
Redistribution involves configuring a routing protocol to advertise routes learned by another routing process. Normally, protocols base their metric on an interface value, such as bandwidth, but no interface for a redistributed route exists. Protocols use incompatible metrics, so the redistributed routes must be assigned a new metric compatible with the new protocol.

A route’s starting metric is called its seed metric. Set the seed metric for all redistributed routes with the default-metric [metric] command under the routing process. To set the metric for specific routes, either use the metric keyword when redistributing or use the route-map keyword to link a route map to the redistribution. After the seed metric is specified, it increments normally as the route is advertised through the network (except for certain OSPF routes).

Tuesday, March 24, 2009

IP Routing Protocols

Routing protocols are used to pass information about the structure of the network between routers. Cisco routers support the following IP routing protocols RIP (versions 1 and 2), IGRP, EIGRP, IS-IS, OSPF, and BGP. This section compares routing protocols and calls out key
differences between them.

Administrative Distance
Cisco routers are capable of supporting several IP routing protocols concurrently. When identical prefixes are discovered from two or more separate sources, Administrative Distance (AD) is used to discriminate between the paths. AD is a poor choice of words; trustworthiness is a better name. Routers use paths with the lower AD. The following figure lists the default values for various routing protocols. Of course, there are several ways to change AD for a routing protocol or for a specific route.


Building the Routing Table

The router builds a routing table by ruling out invalid routes and considering the remaining advertisements. The procedure is:

1. For each route received, verify the next hop. If invalid, discard the route.
2. If multiple, valid routes are advertised by a routing protocol, choose the lowest metric.
3. Routes are identical if they advertise the same prefix and mask, so 192.168.0.0/16 and 192.168.0.0/24 are separate paths and are each placed into the routing table.
4. If more than one specific valid route is advertised by different routing protocols, choose the path with the lowest AD.

Comparing Routing Protocols
Two things should always be considered in choosing a routing protocol: fast convergence speed and support for VLSM. EIGRP, OSPF, and IS-IS meet these criteria. Although all three meet the minimum, there are still important distinctions, as described below:

EIGRP is proprietary, but it is simple to configure and support.
OSPF is an open standard, but it is difficult to implement and support.
There are few books on IS-IS and even fewer engineers with experience who use it. IS-IS is therefore uncommon.

Enterprise Composite Network Model

The Enterprise Composite Model (see Figure 1-3) is broken into three large sections:
Enterprise Campus—Switches that make up a LAN
Enterprise Edge—The portion of the enterprise network connected to the larger world.
Service Provider Edge—The different public networks that are attached

The Enterprise Composite Model

The Enterprise Edge, shown in the following figure, details the connections from the campus to the WAN and includes:
E-commerce
Internet connectivity
Remote access
WAN

The Service Provider Edge is just a list of the public networks that facilitate wide-area connectivity and include:
Internet service provider (ISP)
Public switched telephone network (PSTN)
Frame Relay, ATM, and PPP

The Evolving Network Model


Hierarchical Design Model

Three-Layer Network Design
The layers break a network in the following way:
Access layer—End stations attach to the network using low-cost devices.
Distribution layer—Intermediate devices apply policies.
Route summarization
Policies applied, such as:
Route selection
Access lists
Quality of Service (QoS)

Core layer—The backbone that provides a high-speed path between distribution elements.
Distribution devices are interconnected.
High speed (there is a lot of traffic).
No policies (it is tough enough to keep up).

Problems with the Hierarchical Design Model:
Where do wireless devices fit in?
How should Internet access and security be provisioned?
How do you account for remote access, such as dial-up or VPN?
Where should workgroup and enterprise services be located?