Packetization, or the amount of voice payload placed in each packet, is measured in Milliseconds. The packetization options available to you depend on the CODEC you choose. For the purposes of this post I would like to focus on G.729. The default for CallManager is 20ms and the available options are 20, 30, 40, 50, or 60ms. Voice packets are very different from normal data packets (I use this as a generic term for data traffic, not just layer 3) in that headers make up a major portion (49 - 74%, depending on packetization) of the packet size. By choosing to place more voice (ex. 60ms) in each packet, you are effectively reducing the number of packets needed to carry a second of your voice and also reducing your administrative overhead (non-voice portion of the packet).
Since this all sounds rosey and wonderful, why would Cisco set the default at 20ms? Put another way, what is good about packetizing at a lower increment? More packets, while costing you bandwidth, would help ease the effects of packet loss. Losing a single packet at 60ms would be the equivalent of losing 3 packets at 20ms. The de-jitter buffers on your Cisco routers can make up for the loss of a packet at 20ms, but not at 60ms. Outside of easing packet loss, packetizing at 20ms means you wait for 20ms of voice, then put it into a packet. 60ms then would delay sending that first packet by 40 additional ms. While 40ms is not that big of a deal in the grand scheme of things, it is a fairly significant portion of the 150-200ms recommended one-way delay.
Without going into the math, G.729 uses 31.2Kbps at 20ms and 15.7Kbps at 60ms. So are you willing to part with some survivability and add 40ms of delay to get twice the number of calls? It really depends on your available bandwidth. If you are humming along at OC-192, you would REALLY need to make a lot of phone calls for a change from the default to make sense. In the Marine Corps, a lot of our external communications are satellite based and very low bandwidth. If you are lucky and you only need one satellite hop to get to your destination, you are already at 300ms (propagation delay out to space is a beast). With the recommendations for delay no longer within reach, why not add an additional 40ms and make twice the calls?
Sunday, April 8, 2012
Saturday, March 10, 2012
PRI E-mail Notifications
The focus of this blog post is the use of EEM for automated e-mail notification. The idea (and command examples) came from @ucgod, who you should follow on twitter if you are not already. We are going to configure a voice router to send an e-mail when a PRI T-1 goes up and down at layer 2.
PRI T-1s are capable of carrying voice and/or data traffic, but for the purposes of this post, I am just going to concentrate on the voice side. Your question might be: why send an e-mail notification for something that will show up on your router's command line? In the Marine Corps, and most commercial organizations, the engineers in charge of routing and switching are not in charge of voice (and vice versa). Given that access to the command line is restricted, it is important that the voice engineers are given automated notification. The PRI T-1s (if you are not using IP trunking) are the way your voice calls leave your organization, which would be similar to a WAN connection. Just as you would want to know if your WAN connection is down, voice engineers would want to know if the T-1s are down.
First, we will take a look at what the layer 2 messages look like normally. Q921 is the layer 2 for your ISDN (PRI) connection. You will see below each switchboard sends layer 2 keepalives, very similar to the hello messages our routing protocols use. In this case, my voice router (on behalf of the CallManager) is sending to and receiving from a REDCOM switch. The REDCOM switch sends the same type of messages you would see from your local TELCO. It looks like this:
What we will do is have an e-mail sent to our voice engineer when these keepalives stop being received, and when they are restored following an outage.
We need to start things off by defining some parameters for the e-mail to work with EEM. The examples below show us saying who the e-mail will go to, which e-mail server we will use and who the e-mail will be from. Sadly I did not have access to an e-mail server when I labbed this out, so we won't actually get to see the e-mails.
event manager environment _email_to address@domain.comNext we will need to define the CLI username who will execute the EEM commands. Make sure this username is in the local user database. I also gave this username level 15 access. Tying the local username to EEM will look like:
event manager environment _email_server 192.168.100.10
event manager environment _email_from router@domain.com
event manager session cli username "aishelpdesk"Now we will define our EEM settings. EEM is based off of an "event" which triggers an "action". You can have multiple actions per event if you would like (I have examples of this in a previous post). The events and actions are defined within an EEM applet. Here is an example of the EEM applet for when the PRI goes down at layer 2. Below you can see the action is "down at layer 2", which triggers an e-mail that says what has happened and who you should contact.
event manager applet ISDN_L2_DownThe next applet will define an event of the PRI coming back up at layer 2. The action defined is to send an e-mail reminding you to close your trouble ticket if you had opened one.
event syslog pattern "%ISDN-6-LAYER2DOWN: Layer 2 for Interface"
action 1.0 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "PRI went Down." body "PRI has gone down. Contact <provider> support at 877-XXX-XXXX for circuit ID 38/HCFU/XXXXX//XX."
event manager applet ISDN_L2_UpNow that we have completed our config, it's time to verify it works. As I mentioned before, I do not have access to a mail server, so we will just be able to verify that the EEM event triggers the action. We can verify this by debugging EEM. The command would be:
event syslog pattern "%ISDN-6-LAYER2UP: Layer 2 for Interface"
action 1.0 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "PRI Is Back Up" body "PRI has come back up. If a ticket with provider was opened, please close it."
debug event-manager
Next, we will need to do something to bring the T-1 down. You could unplug the T-1 from the VWIC card, or shutdown the D channel, either one would work. Here is what the debugging messages looked like when I shutdown the D channel:
As you can see from the output, EEM is triggered but fails because it cannot contact my (fictional) mail server. Since there is no mail server, EEM did exactly what we expected. You can even see it lets you know the execution of the applet failed.
Lastly, we will check and ensure the second applet we wrote works. In this case, you bring the D channel back up or reconnect the cable you unplugged. As with any other debug, be sure you turn it off when you are done. Here is what this should look like:
undebug allAgain, EEM fails to contact my mail server and tells us it failed to execute. I'll update this post when we get a mail server to play with, but this should give you a good idea of what your configuration would look like.
***UPDATE***
I setup Exchange 2010 and tested these configs. Originally it failed. After getting an error message, I decided to dig a bit deeper using "debug event manager action mail". The EEM script was good to go, but I kept receiving a "user not authenticated" error. After some google engineering, it appeared I needed to create a receive connector for the router to use. I specified the router's IP address, unchecked all authentication and it STILL failed. Knowing how strange Windows can be sometimes, I checked into the "permission groups" tab and clicked the "anonymous" and "exchange servers". Finally success!
Friday, March 2, 2012
Damage Mitigation Accounts
One of the concepts I was able to convince my significant other on was that if I was going to be teaching Cisco at work, I should be using Cisco at home. The commercial routers are much more reliable and overall it has really been worth the investment. After just over a year, one thing that remained an annoyance was her needing to use the CLI to reset our Cable and DSL connections.
In my studies I came across a unique way to solve this problem. The first portion involves setting up a username and password. After that is done you also need to set that account to point to a menu as soon as you logon. This effectively keeps this account from being able to access the CLI.
In my studies I came across a unique way to solve this problem. The first portion involves setting up a username and password. After that is done you also need to set that account to point to a menu as soon as you logon. This effectively keeps this account from being able to access the CLI.
After the account is created and pointed to the menu, you need to create menu options to choose from. Don't forget to give your user the option to logoff. It is all fun and games until you can't leave your router. In this case I have setup the ability to Shutdown/Restart interfaces for both my Cable and DSL connections.username spouse.lastname privilege 15 secret 5 $1$JpBN$MvK.1EtlPLCgX6Jt517gY/username spouse.lastname autocommand menu SPOUSE
menu SPOUSE text 1 Shutdown Cable InternetTo give the menu the ability to done something other than just look pretty on your screen you are going to need to configure EEM (Embedded Event Manager). In this case, EEM issues a series of commands when menu items are selected.
menu SPOUSE command 1 event manager run SHUTC
menu SPOUSE text 2 Restart Cable Internet
menu SPOUSE command 2 event manager run NOSHUTC
menu SPOUSE text 3 Shutdown DSL Internet
menu SPOUSE command 3 event manager run SHUTD
menu SPOUSE text 4 Restart DSL Internet
menu SPOUSE command 4 event manager run NOSHUTD
menu SPOUSE text 5 Logout
menu SPOUSE command 5 exit
event manager applet SHUTCThis completes the configuration portion. At this point (assuming telnet or SSH is configured), all you need to do is login to your router with the information you just created. The login should look like this:
event none
action 1.0 cli command "en"
action 2.0 cli command "configure terminal"
action 3.0 cli command "int fa 0/0"
action 4.0 cli command "shutdown"
event manager applet NOSHUTC
event none
action 1.0 cli command "en"
action 2.0 cli command "configure terminal"
action 3.0 cli command "int fa 0/0"
action 4.0 cli command "no shut"
event manager applet SHUTD
event none
action 1.0 cli command "en"
action 2.0 cli command "configure terminal"
action 3.0 cli command "int fa 0/1"
action 4.0 cli command "shutdown"
event manager applet NOSHUTD
event none
action 1.0 cli command "en"
action 2.0 cli command "configure terminal"
action 3.0 cli command "int fa 0/1"
action 4.0 cli command "no shut"
All you need to need to do is push a number on a keypad and the specified action is completed. The system will not provide you any feedback, so if you want to verify the configuration takes place, login to the CLI from another account and monitor the console messages.
The next question is, would there be a tactical use for this? If you have a TACACS+ server, you could easily re-create these limitations but you might not always have a TACACS+ server in the field. If you are forced to create someone an account that you believe is dangerous if given access to the CLI this would be a great tactical fix for your problem.
Sunday, February 12, 2012
Default Route Propagation Using BGP and EIGRP
One of the more complicated routing configurations we need to do in the Marine Corps is to propagate a default route. I know you are thinking default route propagation is not rocket science, but there are nuances that make efficient routing more challenging than it may appear. The scenario I have created simulates a pair of screening and point of presence (POP) routers with iBGP connections inside of ASN 1. The POP routers also connect to a router running only EIGRP which simulates what we would see on our LAN routers. R8 contains a number of loopback interfaces to show propagated routes, and a loopback 6.0.0.1/8 that I have used to simulate a default network. The addressing I used was 172.16.X.0/30 where X stands for the routers involved in the connection (for example, the point to point connection from R2 to R4 would be 172.16.24.0/30).
The first thing we need to do is propagate a default route from our screening router to our POP router (R4 -> R2 and R5 -> R3). We could just use the neighbor default-originate command by itself, but this would not allow for proper failover if one of our eBGP neighbors went down. If one of our neighbors went down we would be dropping half of our packets because when they made it to the screening router there would be no path out. We could configure some additional interconnections to account for this, or we could place a condition on the propagation of the default route. In this case, we will create a route-map that must be satisfied in order to generate the default route. We will create the prefix-list, route-map and default-originate statement on R4 and R5. It would look like this:
R1 still does not have a default route. We will need to configure redistribution for this. For the purposes of this example I have created 2-way redistribution on R2 and R3 (this way our simulated backside networks will be in BGP so our pings to ASN 3 networks will succede). One of the gotchas about this configuration is that redistribution does not work for iBGP by default, so we will need an additional command to override that. Here is what that would look like:
The first thing we need to do is propagate a default route from our screening router to our POP router (R4 -> R2 and R5 -> R3). We could just use the neighbor default-originate command by itself, but this would not allow for proper failover if one of our eBGP neighbors went down. If one of our neighbors went down we would be dropping half of our packets because when they made it to the screening router there would be no path out. We could configure some additional interconnections to account for this, or we could place a condition on the propagation of the default route. In this case, we will create a route-map that must be satisfied in order to generate the default route. We will create the prefix-list, route-map and default-originate statement on R4 and R5. It would look like this:
The 6.0.0.0/8 network is the loopback I used to simulate a default network. At this point, R2 and R3 should see the default network. To test your route-map's success try shutting down your loopback for the 6.0.0.0/8 network. The default route will disappear when this loopback is shutdown.ip prefix-list DEFAULT seq 5 permit 6.0.0.0/8!route-map DEFAULT permit 10match ip address prefix-list DEFAULT!router bgp 1neighbor 172.16.24.1 default-originate route-map DEFAULT
R1 still does not have a default route. We will need to configure redistribution for this. For the purposes of this example I have created 2-way redistribution on R2 and R3 (this way our simulated backside networks will be in BGP so our pings to ASN 3 networks will succede). One of the gotchas about this configuration is that redistribution does not work for iBGP by default, so we will need an additional command to override that. Here is what that would look like:
router eigrp 1
redistribute bgp 1 metric 1000 10 255 1 1500
!
router bgp 1
bgp redistribute-internal
redistribute eigrp 1Now that we have configured the 2-way redistribution we run into a problem. In my case when I ran these commands everything was as it should have been on R2. R3 no longer received its default route through its iBGP connection, but through an external EIGRP connection (ultimately coming from R2). This is because of the administrative distance of iBGP (200) and external EIGRP (170). Because we are now only effectively propagating a default route from one source, we will need to make a change to this default configuration. To solve this issue we will need to prefer iBGP to external EIGRP. You could accomplish this by either lowering the AD of iBGP or raising the AD of external EIGRP. I prefer to lower the AD of iBGP. Changing the AD is local to the router (not propagated) so we will need to do this on both R2 and R3. In addition to the change in AD, you will need to reset your BGP connections for the default routes to propagate with the newly configured AD. The command would look like this:
After the neighbor relationships have reestablished, we achieve the desired result on R1 (simulating our LAN routers) of a load-balanced default route.router bgp 1distance bgp 20 169 169
R1#show ip route
Gateway of last resort is 172.16.13.2 to network 0.0.0.0
1.0.0.0/32 is subnetted, 1 subnets
D EX 1.1.1.1 [170/2588160] via 172.16.13.2, 01:21:03, FastEthernet0/1
[170/2588160] via 172.16.12.2, 01:21:03, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
D EX 2.2.2.2 [170/2588160] via 172.16.13.2, 01:21:03, FastEthernet0/1
[170/2588160] via 172.16.12.2, 01:21:03, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
D EX 3.3.3.3 [170/2588160] via 172.16.13.2, 01:21:03, FastEthernet0/1
[170/2588160] via 172.16.12.2, 01:21:03, FastEthernet0/0
D EX 6.0.0.0/8 [170/2588160] via 172.16.13.2, 00:27:04, FastEthernet0/1
[170/2588160] via 172.16.12.2, 00:27:04, FastEthernet0/0
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C 172.16.12.0/30 is directly connected, FastEthernet0/0
C 172.16.13.0/30 is directly connected, FastEthernet0/1
C 172.16.99.0/24 is directly connected, Loopback0
D*EX 0.0.0.0/0 [170/2588160] via 172.16.13.2, 00:27:06, FastEthernet0/1
[170/2588160] via 172.16.12.2, 00:27:06, FastEthernet0/0This is certainly not the only way you can accomplish multihoming and default route propagation, but this is a great start for learning some of the nuances of BGP and EIGRP.
Saturday, February 11, 2012
Route Reflection Myth
A co-worker and I were recently talking about the use of Route Reflectors (RR). He mentioned reading about that when you designate a Route Reflector client, it turns the RR server service on for the router, and whether designated or not, all iBGP peers would become RR clients. I could have sworn I had done a lab and forgotten to assign an iBGP neighbor as a RR client, and the expected routes were not showing up (until I properly set the router up as a RR client). Since I already had a CCNP class on deck, I decided this could easily be decided by a quick lab.
I set up the above scenario to test the hypothesis. R2 is a RR server for R3 and R4. R1 and R5 are both iBGP peers with R2. R1 has advertised its loopback interface (1.1.1.1/32) into BGP via a network statement.
I pulled the following rules from wikipedia:
The results supported my previous lab experience, that RR clients must be individually configured. I've included the pertinent configs from all of the routers, and the routing tables from R3 (showing the reflected route) and R5 (lacking the reflected route). Please keep in mind these configurations were generated to validate a hypothesis and are not reflective of best practices.
I set up the above scenario to test the hypothesis. R2 is a RR server for R3 and R4. R1 and R5 are both iBGP peers with R2. R1 has advertised its loopback interface (1.1.1.1/32) into BGP via a network statement.
I pulled the following rules from wikipedia:
RR servers propagate routes inside the AS based on the following rules:Based on the above rules, R2 received the 1.1.1.1/32 route from a nonclient peer and should reflect to its clients (R3, R4). Because R5 is a nonclient, it should not receive the route. This scenario should prove whether enabling a single RR client enables all iBGP peers as RR clients, or not.
- If a route is received from nonclient peer, reflect to clients only.
- If a route is received from a client peer, reflect to all nonclient peers and also to client peers, except the originator of the route.
- If a route is received from an EBGP peer, reflect to all client and nonclient peers.
The results supported my previous lab experience, that RR clients must be individually configured. I've included the pertinent configs from all of the routers, and the routing tables from R3 (showing the reflected route) and R5 (lacking the reflected route). Please keep in mind these configurations were generated to validate a hypothesis and are not reflective of best practices.
-----------------------------------------------
hostname R1
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.1.0 255.255.255.254
duplex auto
speed auto
!
router ospf 1
router-id 0.0.0.1
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
neighbor 192.168.1.1 remote-as 1
no auto-summary
!
-----------------------------------------------
hostname R2
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.254
duplex auto
speed auto
!
interface Serial0/0
ip address 192.168.1.4 255.255.255.254
clock rate 2000000
!
interface FastEthernet0/1
ip address 192.168.1.2 255.255.255.254
duplex auto
speed auto
!
interface Serial0/1
ip address 192.168.1.6 255.255.255.254
clock rate 2000000
!
router ospf 1
router-id 0.0.0.2
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 192.168.1.0 remote-as 1
neighbor 192.168.1.3 remote-as 1
neighbor 192.168.1.5 remote-as 1
neighbor 192.168.1.5 route-reflector-client
neighbor 192.168.1.7 remote-as 1
neighbor 192.168.1.7 route-reflector-client
no auto-summary
!
-----------------------------------------------
hostname R3
!
interface Serial0/0
ip address 192.168.1.5 255.255.255.254
clock rate 2000000
!
router ospf 1
router-id 0.0.0.3
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 192.168.1.4 remote-as 1
no auto-summary
!
-----------------------------------------------
hostname R4
!
interface Serial0/1
ip address 192.168.1.7 255.255.255.254
clock rate 2000000
!
router ospf 1
router-id 0.0.0.4
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 192.168.1.6 remote-as 1
no auto-summary
!
-----------------------------------------------
hostname R5
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface FastEthernet0/1
ip address 192.168.1.3 255.255.255.254
duplex auto
speed auto
!
router ospf 1
router-id 0.0.0.5
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 192.168.1.2 remote-as 1
no auto-summary
!
-----------------------------------------------
R5#show ip route
Gateway of last resort is not set
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
192.168.1.0/31 is subnetted, 4 subnets
O 192.168.1.0 [110/20] via 192.168.1.2, 02:14:27, FastEthernet0/1
C 192.168.1.2 is directly connected, FastEthernet0/1
O 192.168.1.4 [110/74] via 192.168.1.2, 02:13:31, FastEthernet0/1
O 192.168.1.6 [110/74] via 192.168.1.2, 02:13:21, FastEthernet0/1
-----------------------------------------------
R3#show ip route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 [200/0] via 192.168.1.0, 02:06:36
192.168.1.0/31 is subnetted, 4 subnets
O 192.168.1.0 [110/74] via 192.168.1.4, 02:13:17, Serial0/0
O 192.168.1.2 [110/74] via 192.168.1.4, 02:13:17, Serial0/0
C 192.168.1.4 is directly connected, Serial0/0
O 192.168.1.6 [110/128] via 192.168.1.4, 02:13:17, Serial0/0
Unadulterated Nerdery Goes Live
I've finally decided to bite the bullet and finally to go live with the blog. I am not particularly great at anything in networking, VoIP or security but I wanted to start this blog as a way to put out there some of the things I have learned along the way.
Subscribe to:
Posts (Atom)





