E1 Link Clocking on Cisco Voice Gateways – How to Avoid “Slips”

Good morning! 🙂
Recently, at one of the courses, my students asked me the question – how to get rid of such a phenomenon as “slips” on the E1 links when connecting a Cisco gateway to another PBX or to PSTN? I would like to suggest a solution for everyone who faced a similar problem.
What is a “slip”? This is the term used for one of the errors related to the wrong clocking  (desynchronization) of the E1 link. For the correct operation of the E1 stream, its exact clocking with the opposite side is necessary in order to know at what points in time the samples of certain timeslots are transmitted. If the clocking is wrong, the PBX can mistakenly take the sample bits of neighboring timeslots for the sample bits of this time slot, i.e., in other words, the PBX does not know at what point in time the sample bits of this timeslot are transmitted.
An example of such wrong clocking is shown in the following figure:

As it can be seen from the figure, the PBX of side B erroneously takes the last bit of the first sample of the first timeslot as the first bit of the second timeslot, the last bit of the second timeslot as the first bit of the third timeslot, and so on. There is an overlap of neighboring timeslots. This phenomenon is called “slip”. “Slips” lead to the fact that, first of all, fax transmission is disrupted in the E1 links, analog modem connections do not work, clicks, crackles, and noise can be heard in the speech.

In order to prevent this from happening, the E1 links transmit a frame reference signal or, in other words, a synchronization signal. It has the value 10011011 and is transmitted in time slot 0 of even frames (i.e. frames 0, 2, 4, 6….):
When using E1 links, it is assumed that clocking is usually set by the Network side. The slave side (User) must synchronize on a zero timeslot signal received from the master side.
Let’s assume that the Cisco gateway is connected via E1 (port 1/0) to the PSTN. In this case, the PSTN is the master (Network) and the gateway is the slave (User). In order for the gateway to receive clocking from the PSTN, it is necessary to configure two IOS commands on it:
1) The clock source line command in the E1 controller configuration mode indicates that the gateway is waiting for clocking from the Network side. This command is set by default.

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#controller e1 1/0
Router(config-controller)#clock source line

2) It is necessary to specify from which E1 port clocking will be performed. This is done using the network-clock-select command in global configuration mode. Even if only one E1 link is used in your gateway, this command must still be configured. Without it, the gateway does not know where to get clocking from. If this is not done, then you will get an out-of-sync E1 link.

Router(config)#network-clock-select 1 e1 1/0

After entering this command, the gateway starts to synchronize from the Network side, and the “slips” does not appear.
The check for clocking on the E1 links is carried out as follows. First, clear the values of all counters on the interfaces, for example, using the clear counters command:
Router#clear counters

Then look at the value of the “slip” counter for the given E1 link. If the stream is synchronized, then “slips” are not observed:

Router#sh controller E1
E1 1/0 is up.
  Applique type is Channelized E1 – balanced
  Description: PSTN_E1
  No alarms detected.
  alarm-trigger is not set
  Version info Firmware: 20090408, FPGA: 255, spm_count = 0
  Framing is CRC4, Line Code is HDB3, Clock Source is Line.
  Current port master clock:recovered from backplane
  Data in current interval (396 seconds elapsed):
     0 Line Code Violations, 0 Path Code Violations
     0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
     0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
  Total Data (last 4 15 minute intervals):
     0 Line Code Violations, 0 Path Code Violations,
     0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins,
     0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs

If the stream is not synchronized, then the number of “slips” is not equal to zero and is constantly growing:

Router#sh controller E1
E1 1/0 is up.
  Applique type is Channelized E1 – balanced
  Description: PSTN_E1
  No alarms detected.
  alarm-trigger is not set
  Version info Firmware: 20090408, FPGA: 255, spm_count = 0
  Framing is CRC4, Line Code is HDB3, Clock Source is Line.
  Current port master clock:recovered from backplane
  Data in current interval (396 seconds elapsed):
     0 Line Code Violations, 0 Path Code Violations
     0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
     0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
  Total Data (last 4 15 minute intervals):
     0 Line Code Violations, 0 Path Code Violations,
     130 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins,
     130 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs