Telecommunications Protocols Fundamentals

The need for communication amongst people and electrical systems motivated the emergence of a large number of telecommunications protocols. The advances in digital networks and the internet have contributed to the evolution of telecommunications worldwide. The purpose of this chapter is to provide students and researchers with a clear presentation of telecommunications core protocols that are utilised in different research domains including telephony, brain-computer interface (BCI) and voice and digital telecommunications. Indeed, BCI involves different electrical signals, communications concepts and telecommunications protocols. This chapter introduces the reader to the core concepts in communications including analogue and digital telecommunications protocols that are utilised generally in communications and in particular in BCI systems. The topics covered in this chapter include telecommunications protocols, communications media, electrical signals, analogue and digital modulation techniques in digital communications, software-defined radio, overview on 10-Mbps Ethernet protocol and Session Initiation Protocol (SIP).


Introduction
Telecommunications protocols play an important role in the advanced modern communication systems that convey information, signals and messages over short and long distances. Telecommunications protocols were developed for data (digital) and voice (analogue) messages.
In a typical brain-computer interface (BCI) [1] application, the electroencephalography (EEG) [2] signals are acquired from the brain, encoded and sent over wireless protocols, such as Bluetooth or Wi-Fi data channels, to a control module. However, in a basic BCI system, signals may be sent through wires between signal acquisition and control modules through a certain serial data communications protocol. BCI is one of several vital engineering domains where researchers and students have to understand and deal with telecommunications protocols.
The need for data communications has inspired researchers and led to the emergence of digital communications, integration of Voice over Internet Protocol (VoIP) or IP telephony with multimedia services offered on IP networks over public switched telephone network (PSTN). Modern telecommunications through VoIP software are common on personal computers and portable devices including smart phones and handheld devices. VoIP systems employ packet switching protocols, which have numerous advantages over circuit switching upon which is based on the traditional PSTN.
VoIP applications for local area network (LAN), wide area networks (WAN), wireless local area network (WLAN) and mobile telephone networks offer better availability, scalability, flexibility, minimum hardware and low cost than PSTN. On the other hand, Internet-related problems such as delay and congestion causing jitter and packet loss are inherent in VoIP.
However, circuit switching is compelling in many applications where real-time, low delay and high QoS are desired, where each customer of modern PSTN profits from dedicated analogue or digital circuits. This implies that a communication channel is reserved during a call or a data session. Due to the limited number of circuits and control units in PSTN, only a fraction of customers can perform simultaneous calls within a switch.
One of the main protocols that has been developed for IP telephony is SIP, which is inspired from establishing and ending a call session and for changing parameters of an established session. The simplicity of SIP and the emergence of Java application interfaces for integrated networks (JAIN)-SIP which is a Java-based API for SIP have reinforced the development and implementation of platform-independent IP telephony services.
In this chapter, core concepts in telecommunications protocols, as well as other related topics including communications media, analogue and digital modulation techniques in digital communications, software-defined radio, overview on 10-Mbps Ethernet protocol and SIP protocol, are presented in an easy and simple style with a number of figures to explain the basic principles of telecommunications protocols.

Telecommunications core concepts
This section introduces the reader to selected core concepts in telecommunications including telecommunications media and digital encoding.

Twisted pair
Twisted pairs are utilised to carry analogue and digital signals. Depending on distance, analogue signals may be limited to 250 kHz, and digital signals are limited to 10 Mbps for distances around 100 m [3]. At the onset of electrical telecommunication systems, copper was the main transmission medium because of its electrical characteristics such as low resistivity to electric current.

Morse code
The Morse code is a variable-length code, where each character is given a series of dots and dashes. Some letters have one dot and others have one dash. The code length varies from 1 to 5, covering 36 symbols. The telegraph signals were carried using copper twisted pairs. Signal wires are twisted in order to cancel out unwanted noise and reduce the effective inductance of the transmission line. At the sending side, a switch is used to open and close the electric circuit in a certain pattern in order to produce Morse code at the receiving side.

Coaxial cable
A coaxial cable consists of a core wire and a cylindrical shield separated by insulation material. It provides better noise rejection and baud rate over longer distances than the twisted pair. Analogue signal frequency can exceed 500 MHz, and baud rate can reach 500 Mbps depending on distance.

Optical fibre
Optical fibre systems consist of a laser diode transmitter and receiver separated by transparent optical fibre. The signals are transmitted as light pulses that propagate inside the optical fibre. The optical fibre has small diameter and consists of three components: the core (pure glass or plastic), the cladding and the protective cover. The cladding material (glass or plastic) is less optically dense, which allows the light to travel easier through the core. The optical fibre can be used on longer distances with attenuation.

Wireless transmission
Radio and TV broadcasting was made possible through various modulation techniques of electrical signals over different carrier frequencies. For example, the short waves (SW) include frequencies from 3 up to 30 MHz, very high frequencies (VHF) range from 30 to 300 MHz and ultra-high frequency (UHF) cover frequency spectra from 0.3 to 3 GHz. Lower frequencies have longer propagation distances, while higher frequencies suffer from reflections and attenuation over long distances. On the other hand, radio frequency (RF) and high-frequency (HF) transmissions require small antennas since their wavelengths are much shorter.

Microwave transmission
With shorter wavelengths in the range 4-6 GHz, microwave signals travel in straight lines and do not penetrate solid objects. They are affected by clouds, rain and obstacles blocking the line of sight between the transmitter and receiver. Usually parabolic antennas are used for large systems. The received signal is focused at the focal point of the parabola.

Very small aperture terminal (VSAT)
In the 1980s, the very small aperture terminal devices made it possible to telecommunicate, utilising small dish dimensions between remote areas by means of highly directional parabolic antennas [4].

Telephone systems
The microphone in a telephone set converts sound into analogue electric signals that are conveyed traditionally through copper wires and reproduced back at the receiver into sound waves through the speaker. The first telephone systems were analogue, while today's telephone systems are completely digital with tone dialling, voice and data services. Telephone networks have profited from advancements in wireless communications by the implementation of the mobile [5, 6] communications. Old telephone networks were designed mainly to convey voice before the emergence of digital data networks and the Internet.

Analogue and digital signals
Digital signals are characterised by two discrete levels, high and low (1 or 0), while analogue signals have continuous forms. Digital and analogue signals are both utilised in modern telecommunications [7] systems and computer networks. Popular digital codes include American Standard Code for Information Interchange (ASCII) and binary-coded decimal (BCD). ASCII is used in basic character symbols for computer systems, while BCD is mainly used for seven-segment displays.

Non-return to zero (NRZ)
Non-return to zero is the simplest digital encoding as shown in Figure 1, where a logic one corresponds to a positive high signal level and the logic zero is simply at ground potential or zero voltage. The NRZ encoding is inconvenient for data transmission specially when data contain a long series of zeros or ones.

Return to zero (RZ)
Return to zero is an improved digital encoding over the NRZ encoding, where logic one signals return to zero as shown in Figure 2. The RZ encoding is inconvenient for data transmission when data contain a long series of zeros.

Manchester encoding
To assure reliable transmission of digital data (such as Ethernet and IP), the Manchester encoding (refers to Figures 3 and 4 with clock signal) is convenient to solve the issue of sending a long series of zeros or ones through a data communication line. The Manchester encoding encodes logic 1 as a transition from level high to low signal, while a 0 is a transition from low to high. The needed bandwidth is twice as the original signal, and there is always a change in the middle of each bit.
An improved version of this encoding is called the differential Manchester encoding, where a 0 causes the signal to change at the start of the interval (refer to Figure 5). On the other hand, a 1 causes a change at the end of the interval. A 1 keeps the signal level unchanged as in the previous bit and changes to high at the middle. This is advantageous and permits interchanging the wiring of a differential pair without any issue.

Shannon's theory
Shannon studied noisy channels, and his theory is based upon the fact that a signal has to have high signal-to-noise (S/N) ratio in order to be successfully distinguished. This influences the maximum bit rate that can be used as follows: To increase the data rate, a channel with high S/N should be used. Other means that can increase the bit rate is data compression.

Sampling theory
To convert a continuous signal x(t) into a digital form [8], it is first sampled at equal intervals of time. To be able to reconstruct a sampled signal, x δ t ð Þ is defined as The sampling interval T s is 1/f s , where the sampling frequency f s should be at least twice the highest frequency component f max of the original signal x(t). The frequency 2f max is called the Nyquist frequency.

Analogue-to-digital (A/D) conversion
An analogue signal with a given frequency f 1 can be converted into a digital form by sampling it at a constant frequency f s , where f 1 , f s . A sampled signal has the form of pulses with different amplitudes called pulse amplitude modulation (PAM). The PAM signal is then quantised, and every level is given a binary code number. This process is called pulse-code modulation (PCM). The sampling frequency f s has to be at least twice as much as the signal frequency being sampled f 1 in order to produce a good approximation of the original signal that can be reproduced and converted back to analogue form. In telephony systems the 8-kHz frequency is used to sample voice that is encoded using 8-bit code. The bit rate in this case is 8000 Â 8 ¼ 64 kbps. In compact disc (CD) technology, the audio is sampled at 44:1 kHz.

Modulation techniques
In the past, digital networks were connected through telephone networks via the modem (modulation/demodulation). Modern telecommunications systems utilise optical fibres that carry many digital channels, which can be translated into voice signals in a telephone by using a codec (coder/decoder). This involves digital-toanalogue (D/A) and analogue-to-digital (A/D) conversions. When a signal m t ð Þ ¼ A m cos 2πf m t þ ϕ m t ð Þ À Á is transmitted, it is normally modulated using a carrier c t ð Þ ¼ A c sin 2πf c t þ ϕ c t ð Þ À Á signal, which can be changed or modulated in amplitude (A c ), phase shift (ϕ c ) or frequency (f c ) [9]. The carrier signal can be generalised as c t ð Þ ¼ A c t ð Þ sin 2πf c t þ ϕ c t ð Þ À Á Â Ã .

Analogue modulation
To transmit analogue signals over long distances, analogue modulation techniques are used by changing either the amplitude, phase or frequency of analogue signals.

Amplitude modulation (AM)
Amplitude modulation (AM) takes place when A c t ð Þ is linearly related to the modulating signals (message). In this modulation technique, the carrier frequency is kept constant, and its amplitude is varied according to the amplitude of the transmitted analogue signal as shown in Figure 6. An AM signal y t ð Þ is the result of multiplying the message m t ð Þ and carrier c t ð Þ functions. Assuming a sinusoidal carrier signal defined as c t ð Þ ¼ A c sin 2πf c t À Á is used to modulate the message signal m t ð Þ ¼ A m cos 2πf m t þ ϕ t ð Þ À Á : In the above equation, m is the modulation index, which is the ratio of the amplitude of the message signal A m to the amplitude A c of the carrier signal.
To be able to recover the message, m should be less than 1, i.e., 1 , m . 0. The resulting product function y t ð Þ is composed of three frequencies: The equation above shows three frequencies: 1. The carrier frequency f c .
2. The sum of the carrier and modulated frequencies f c þ f m þ ϕ with the same phase shift of the message signal.
3. The difference between the carrier and modulated frequencies f c À f m À ϕ with the negative phase shift of the message signal.

Frequency modulation (FM)
Frequency modulation (FM) takes place when the time derivative of ϕ t ð Þ is linearly related to the modulating signal. In this modulation technique, the amplitude of the carrier signal is kept constant, and its frequency is varied according to the amplitude of the transmitted analogue signal as shown in Figure 7. Frequency and phase modulations are considered as special cases of angle modulation s t ð Þ ¼ A c cos 2πf c t þ ϕ t ð Þ À Á . The carrier frequency is changed such that the frequency f c depends on the message signal. Since the frequency is the derivative of the phase, the relation between the input signal and frequency can be written as [9] The FM signal y t ð Þ can be written as In the above equation, A m is the amplitude of the message signal, f m is the frequency of the message signal and f Δ is the maximum frequency that corresponds to the maximum amplitude A m value. The frequency modulation index m f describes the variation in carrier frequency compared [10]: The frequency modulation index can be less than 1 (for narrowband FM) or much greater than 1 (for wideband FM).

Phase modulation (PM)
Phase modulation (PM) takes place when ϕ t ð Þ is linearly related to the modulating signal. In this modulation technique, the amplitude of the carrier signal is kept constant, and its phase is varied according to the amplitude of the transmitted analogue signal as shown in Figure 8. The phase of the PM signal can be written in terms of the phase modulation index m p as ϕ t ð Þ ¼ m p m t ð Þ.

Digital modulation
Transmission of digital signals involves modulation of amplitude, frequency or phase of carrier signals. The difference between analogue and digital modulation is that in digital modulation, the changes are at discrete intervals. For example, the amplitude of the carrier signal can be assigned to a maximum value or zero to represent the binary data 1 and 0.

Frequency-shift keying (FSK)
Frequency-shift keying is called also frequency modulation (FM). A bit 0 corresponds to low frequency, and a 1 corresponds to high frequency as shown in Figure 9. An FSK signal s(t) can be written as In the equation above, k is a constant shift in frequency. Obviously, the FSK uses two frequencies ( f c þ k and f c À k) for logic 0 and 1, respectively. This type of FSK is called binary FSK (BFSK).
In case k and 3k are used to shift the carrier frequency, the resulting FSK signal has four different frequencies and can be utilised to encode the binary codes 00, 01, 10 and 11, as follows:

Amplitude-shift keying (ASK)
Amplitude-shift keying is similar to amplitude modulation (AM) as shown in Figure 10. Each signal amplitude is assigned to a sequence of bits. If four amplitudes   are considered, the following bit code sequences can be defined as 00, 01, 10 and 11. A ASK signal s(t) can be written as

Phase-shift keying (PSK)
Phase-shift keying (PSK) is also called phase modulation (PM). The signal can have a variable phase as shown in Figure 11. If the signal is compared with its predecessor, this technique is called differential phase-shift keying (DPSK). Each phase shift can be assigned to a given binary code [11]. A PSK signal s t ð Þ can be written as Since the above equation contains two distinct phases, this type is called binary phase-shift keying (BPSK). If the number of phase variations is increased to 4, the quadrature PSK (QPSK) ca be defined as follows:

Quadrature amplitude modulation (QAM)
Though the above three approaches can be used with any number of signals, they tend to be difficult to implement due to the fact that special hardware will be needed to distinguish between adjacent amplitudes, phases and frequencies. To overcome this limitation, a combination of bits can be assigned to groups of signals that can be different in amplitude and phase, for example. For example, using signals with two amplitudes and two phase shifts produces four different signals.

Analogue pulse modulation
Pulse modulation can be achieved by modifying either amplitude, width or position of a pulse signal: • Pulse amplitude modulation (PAM): The PAM signal (as shown in Figure 12) is similar to the sampled signal. The pulses in PAM can have a finite width unlike the sampling delta pulses. The PAM-modulated signal y t ð Þ can be written as • Pulse width modulation (PWM): In PWM as shown in Figure 13, the width of each pulse is related to the modulating signal. This type of modulation is used in DC motor control applications.
• Pulse position modulation (PPM): In PPM as shown in Figure 14, the position of each pulse is related to the modulating signal.

Digital pulse modulation
Digital pulse modulation includes two types: 1. PCM: This modulation technique is achieved by sampling the message signal and assigning a digital code (quantisation) to each pulse. The level of the signal is not transmitted; instead the quantised code is assigned according to the available bits for encoding. For example, in 8-bit PCM (with n ¼ 8), each level is assigned to a discrete value between 0 and 255. For a signal that has a bandwidth (BW) and a sampling rate of 2BW, the number of transmitted pulses becomes 2nBW.
2. Delta modulation: In delta modulation, only the difference between the previous and following codes is sent, as shown in Figure 15. For a reference signal m s t ð Þ and a message signal m t ð Þ, the difference Δ t ð Þ is computed and fed to a pulse generator in order to produce the delta-modulated signal to be transmitted: Figure 11. PSK modulation.
In Figure 15, the reference signal m s t ð Þ is the signal with rectangular edges superimposed on the smooth sine wave message signal. The reference signal is obtained by integrating y t ð Þ as follows [8]: The difference value Δ nT s ð Þ is calculated at the nth sampling instant. The reference signal m s t ð Þ is a stair-step approximation of m t ð Þ as shown in Figure 15.

Session initiation protocol (SIP)
Modern telephony systems are based upon the Voice over IP (VoIP) protocols, such as SIP, which is a call control and signalling protocol adopted by the 3GPP in  order to deliver IP multimedia services [12] to the mobile network [6]. The design of SIP was inspired from HTTP protocol and standardised by the Internet Engineering Task Force (IETF). The purpose of SIP is to enable initiating, terminating interactive call sessions and changing parameters of ongoing sessions. The simplicity of SIP and the emergence of JAIN-SIP [13] have facilitated the development and implementation of platform-independent IP telephony services. Multimedia sessions enable communicating via voice, video and text. SIP messages are either requests or responses and use Session Description Protocol (SDP) in order to determine and negotiate session parameters at either endpoint. SIP supports name mapping and redirection functionalities and, thus, permits user mobility. A typical SIP architecture consists of SIP user agents (UAs) and servers.

Software-defined radio (SDR)
Software-defined radio (SDR) [14] is a wireless communication device that employs software to perform most of the operations that are traditionally done by hardware in conventional radio circuits. Similar to the first radio receivers, SDR uses the same hardware for antenna and RF amplifiers. Unlike traditional radios that are based upon hardware to perform modulation and demodulation, softwaredefined radios are dependent on software to achieve filtering, modulation and demodulation. The IF signal is sampled and converted to digital signal that can be manipulated using software. Common modules between traditional radio and SDR include the antenna and the D/A and A/D converters. Some SDR implementations are freely available using field-programmable gate arrays (FPGA) [15].

Overview of 10-Mbps Ethernet
The core protocol of the Internet is the Ethernet protocol, which is based upon serial digital communications. This section provides an overview on the 10-Mbps Ethernet standard. The composition of Ethernet frames (at the MAC sub-layer) and the generation of differential signals at the physical interface (Phy) layer can be implemented on different hardware types as well as FPGA through hardware description language (HDL) code. For 10-Mbps Ethernet, Manchester encoding is utilised, where every bit of information is encoded as a transition from 1 to 0 or from 0 to 1.This is advantageous for the synchronisation between the sender and the receiver and for the recovery of the transmission clock. This encoding method prohibits sending consecutive zeros or ones, which appear as constant DC signal in a conventional RZ encoding. Since every bit of information is composed of two voltage levels, the reference clock is at 20 MHz (double the baud rate).
To identify the beginning of an Ethernet frame, a special pattern of bits is sent, which consists of preamble and a start of frame delimiter (SFD). The preamble and SFD are sent prior to the actual data. The pattern '10' is repeatedly sent, such that a total of 62 bits of 101010 are followed by 11. The last byte (SFD) is 10101011. In hexadecimal, the preamble is 7 bytes of 0x55 followed by a single SFD byte of 0xD5. The first byte that is sent is 0x55, whereas the byte 0xD5 is sent last. The leftmost bytes are sent first, of which the rightmost bits (LSB) are sent first. This is why the first byte in the preamble 10101010 is sent from right to left, as 0x55, i.e., the first bit to be transmitted, is 0. Data are usually transferred from an FPGA to the Ethernet port through a physical interface. Taking into consideration the mediaindependent interface (MII) standard, where the Phy interface communicates nibbles (4 bits) at a time, the SFD 10101011 byte is sent as 0xD and 0x5, since the lower nibble 0xD (in binary, 1011) is sent first starting by 1 (rightmost bit). The reference clocks are 2.5 and 25 MHz for 10-Mbps and 100-Mbps Ethernet, respectively. Reduced MII (RMII) and serial MII (SMII) are two reduced versions of MII, where 2-bit and 1-bit bus widths are used for the Phy, respectively. Compared to the 10-Mbps MII, the gigabit MII (GMII) communicates through 8-bit width bus with a reference clock of 125 MHz. However, the 10-Gbit MII (XGMII) standard deals with 32 bits of data at a time.
Some implementations of Ethernet on FPGA depend upon finite state machines (FSM) programmed in HDL, such as VHDL. Several open-source codes [13] offer Ethernet implementations in VHDL or Verilog.

Conclusion
This review chapter contains an overview of telecommunications protocols that are part of modern telecommunications systems. This chapter also provides an overview on analogue and digital signal modulation techniques that are currently used in many research fields including BCI. The researcher in BCI domain as well as the electrical engineering student may find the flow of information smooth and convenient.
The information in this chapter are intended to introduce the reader as well as the researcher in BCI to the core concepts in communications and to analogue and digital telecommunications protocols in an easy-to-follow approach supported with multiple figures and mathematical expression.
The topics covered in this chapter include core concepts in electrical signals, communications, telecommunications protocols as well as other related topics including communications media, analogue and modulation techniques, softwaredefined radio, 10-Mbps Ethernet protocol and SIP protocol. The topics in this chapter are presented in an easy and simple style with a number of figures to explain the basic principles and fundamentals of telecommunications protocols.