The OSI 7-Layer Reference Model by Hoang Lihuo


    The Open Standards Interconnection model (OSI) is a network architecture reference model developed by the International Organization for Standardization in the 1980s. It is a conceptual model rather than a real-life implementation designed as a reference for developing network architectures and protocols.

    Having a standardised, multi-layer model has a number of benefits:

        +        Modularisation and abstraction – different components can handle different layers of the stack.             If you’re a web developer, you just need to worry about the application layer, not the full stack. 

 +      Standard interfaces – interaction between layers is well defined so that you can design your   product to run on top of a lower layer protocol regardless of who developed that.

 +         Interoperability – protocols at each layer are specified such that different vendor equipment       should be able to talk to each other at the same layer.

The OSI Reference Model is referred to as a 7-layer model because the total set of functions required to interwork diverse systems was defined and then broken up into seven groups or layers, and arranged in a hierarchy. Each layer has a name and a number. We start numbering at the bottom:

        1: Physical Layer The physical layer provides a raw bit stream service. It moves 1s and 0s between the systems. This is all it does, but it has to do this completely. The physical layer includes the mechanical, electrical, functional and procedural specifications for moving binary digits over a physical medium. 

        2: Data Link Layer The data link layer manages communications on a single circuit, a single link . There may be several stations connected to the circuit – a multidrop circuit – but it is a single physical circuit. Typically sends frames or cells of data across the physical medium with an error check, and performs flow control on the link. This allows communications of blocks of data to another computer on the same circuit. 

        3: Network Layer What happens if we don't have a single link, but 86 of them, and we do not want our data broadcast to all 86 destinations, but rather want it routed and delivered to just one destination? This is the definition of a network… moving data from one link to another, essentially a forwarding function.
     
     4: Transport Layer If the receiver isn't on our network, but on another one, and the networks are connected together with data circuits, or worse yet, multiple intervening networks, how do we know that our data got delivered? The transport layer provides end-to-end error checking to verify that the data was successfully delivered to the far end, and in some cases, retransmit data that was not. Also specified in the transport layer header is the source and destination port number; essentially an identification of which computer program to communicate with on the far-end computer.
      
        5: Session Layer The session layer manages sessions between applications, including initiation, maintenance and termination of information transfer sessions. Usually this is visible to the user by having to log on with a password. SIP is another example of a session layer protocol, used to set up Voice over IP phone call sessions.

         6: Presentation Layer The presentation layer is very important: this is the coding step. How are we going to represent our message in 1s and 0s? ASCII is an example of a presentation layer protocol. Compression and encryption can also be discussed here – they too are methods of coding messages into 1s and 0s.

         7: Application Layer Sitting on top of all of this is the application layer. The application layer defines the format of the messages that will be exchanged, and is usually bundled with a Human-Machine Interface - the applications you and I use to get access to all of this wonderful distributed computing and communications.

Networks and Packets by Hoang Lihuo


Network packet is a formatted unit of data carried by a packet-switched network. A packet consists of control information and user data; the latter is also known as the payload. Control information provides data for delivering the payload (e.g. source and destination network address, error detection codes, or sequencing information). Typically, control information is found in packet headers and trailers.

In packet switching, the bandwidth of the communication medium is shared between multiple communication sessions, in contrast to circuit switching, in which circuits are preallocated for the duration of one session and data is typically transmitted as a continuous bit stream. 

    The word “network” comes from fishing nets, where we have many strings tied together to form a mesh, and one could trace many different possible routes between any two knots or nodes on the net-work.

    In the data communications business, we use the word network in the same way. Networks consist of network equipment connected together with high capacity circuits. Normally, there are redundant connections and multiple routes could be followed between any two pieces of network equipment.

    Access circuits are connected to each piece of network equipment, and users transmit data over the network by sending it into the network over an access circuit, whence it is transferred between network equipment to the receiving end, then delivered over the far-end access circuit.

Packets are blocks of data with network control information. The most interesting type of network control information is the network address, which indicates the final destination of the packet.

    All network equipment, such as routers, look at the network address to decide which route to take to get to that destination. Data to be transferred over a network must be formatted into packets with network addresses regardless of which type of data circuit is used. The most popular protocols for this is the Internet Protocol (IP).

The definition of a network is having to make a routing decision: which route to take to get to the destination.If there are no one-of-many route decisions being made, for example, if the data is broadcast to every station, then it is not, strictly speaking, a network. 

Voice Digitization Standard: DS0 by Hoang lihuo



  • - Quantization: 256 levels
  • - Sampling: 8,000 samples/second
  • - Coding: 8 bits/sample
  • - “Pulse Code Modulation” (PCM)
  • - 8,000 bytes per second
  • - 64,000 bits/second = 64 kb/s
  • - DS0 rate
    There are three steps in voice digitization: quantization, sampling and coding.
The telephone system quantizes the voice signal to 256 levels. This number is chosen to reduce the quantization error, which would be heard as noise after the signal is reconstructed, so that a person can’t hear it on the line. The diagram shows bin numbers 127 and 128 around zero volts.
The second step is sampling. Since this is a voiceband signal, the frequency bandwidth is about 3000 Hz, and so the sampling rate must be at least 6001 times per second, following the Dr. Nyquist’s sampling theorem. To ensure that there are no aliasing errors, the telephone system samples more often: 8,000 samples per second.
    The third step is coding. The telephone system uses 8 bits to code the value of each sample. This technique of using 8 bits per sample is called by some Pulse Code Modulation (PCM), which doesn’t really mean anything. To determine the number of bits per second required, multiply the number of samples per second (8,000) by the number of bits per sample (8) to get 64,000 bits per second, or 64 kb/s for short. This 64 kb/s rate is called a DS0 rate signal (Digital service level zero, or digital signal rate zero, just called “DS0s” in the business). This is the base rate of most transmission systems and digital voice systems. When someone talks about a channel on a digital transmission system, they usually mean a DS0.
Commercial transmission systems which are actually deployed were designed to carry digitized voice, and thus move multiple DS0s. Since they are digital systems, they can be easily be adapted to carry data or video as well as digitized voice.
    The bottom line: we move a byte (representing the value of the sample) 8,000 times/second from one end to the other, for each voice.

Voice Digitization Principles. by Hoang Lihuo

Voice Digitization Principles

    In this tutorial, we understand how voice is digitized - turned into a stream of 1s and 0s to be communicated over the IP packet-based telecommunications network.

    This is a necessary step for carrying Voice over IP, which is taking over the world, and was used on older channelized SONET and T1 trunk carrier systems.

There are three steps in voice digitization: quantization, sampling and coding:

  • Quantization: Change from continuous in value to discrete in value 
  • Sampling: Change from continuous in time to discrete in time 
  • Coding: Code value of sample into 1s and 0s 

    Quantization is the process of changing from a signal which is continuous in value to a signal which is discrete in value.

    This is accomplished by dividing the possible range of values into a number of "bins" or levels or steps, and assigning a number to each of these levels.

    Then, when asked what the value of the signal is, we say that the signal is "in level #42" rather than measuring its voltage.

    Another example of quantization is sugar cubes. Instead of putting some fractional value of a bag of sugar in your coffee, your choice is "one lump or two".The sugar has been quantized into uniform lumps.


    Sampling is the process of changing the signal from being continuous in time to one that is discrete in time. 


    On a regular basis, we take the value of the signal and record it. The value of the signal is the level number.

    How often do we need to sample the signal?

    A mathematician by the name of Nyquist proved that the signal has to be sampled more than twice as often as the frequency bandwidth of the signal to be able to reproduce it. This is called the Nyquist Rule. 


    Code: The value of the signal taken at each sample (the level number) must be coded into 1's and 0's so that it can be transmitted over a digital carrier system or stored in a computer.

    At the far end, we perform the reverse process: re-creating the analog waveform from the received codes by de-coding the level number, generating a voltage with a value equal to that of the center of the level, and smoothly changing the voltage in this manner as each new code comes down the line.

    The whole point in doing this is to move the analog voice signal from the near-end loop to the far-end loop without adding in any noise.

    There is in fact a small amount of noise added in, up front, as part of the analog-to-digital conversion.

    This is the quantization error, the difference in value between the center of the level, and where the signal actually was.

    How do we make the quantization error smaller on average? Make the levels finer.

    How many levels does the telephone company use? Enough so that a human can't hear the quantization error noise on the line. 

Analog Circuits by Hoang Lihuo


  • Telephones transmit information over copper wires using voltage
  • Voltage is a representation or analog of speaker’s voice
  • “Analog” circuit

The technique for representing information on an ordinary local loop is called analog. This term is often thrown about with little regard for its actual meaning, so we’ll spend a bit of time understanding of what is meant by “analog”.

The term analog comes from the design of the telephone: a microphone in the telephone handset is placed in the path of the sound pressure waves coming out of the speaker’s throat. As the sound pressure waves hit the microphone, they change its electrical characteristics.

We use the fact that the electrical characteristics of the microphone change as the sound pressure waves hit it to make a voltage on the telephone wires change.

This voltage is a representation or analog of the sound pressure waves.

This is all we mean by analog: representation.

The voltage on the wires is an analog of the sound pressure waves coming out of the speaker’s throat.

People then stretch the terminology to call the two copper wires which form the telephone line an analog circuit, which is not very accurate.

It would be more accurate to call the loop "two copper wires that were designed to be able to carry a voltage that is a direct representation of the strength of the sound pressure wave impacting on the microphone".  But that takes a long time to say, so people call them "analog circuits".

Note that the only thing analog in this story is the method for representing information on the copper wires.

We can use digital techniques on the same wires.


Public Switched Telephone Network (PSTN)by Hoang Lihuo.

   The public switched telephone network (PSTN) is the aggregate of the world's circuit-switched telephone networks that are operated by national, regional, or local telephonies operators, providing infrastructure and services for public telecommunication.

     The PSTN consists of telephone lines, fiber optic cable, microwave transmission links, cellular networks, communication satellites, and undersea telephone cables, all interconnected by switching centers, thus allowing most telephones to communicate with each other. Originally a network of fixed-line analog telephone systems, the PSTN is now almost entirely digital in its core network and includes mobile and other networks, as well as fixed telephones. 

    The technical operation of the PSTN adheres to the standards created by the ITU-T. These standards allow different networks in different countries to interconnect seamlessly. The E.163 and E.164 standards provide a single global address space  for telephone numbers. 

    The combination of the interconnected networks and the single numbering plan allow telephones around the world to dial each other. 

    Many communication technologies are based on those used in the Public Switched Telephone Network (PSTN), so regardless of whether you're interested in voice, data or networking, it is important to have an understanding of the structure and operation of the telephone network. 

    We begin with a basic model for the telephone network and will build on it in subsequent discussions. At the top of the diagram, we have a telephone and a telephone switch. The telephone is located in a building called a Customer Premise (CP), and the telephone switch is located in a building called a Central Office (CO). One could refer to the telephone as Customer Premise Equipment (CPE).


Operators:  

    The telephone is connected to the telephone switch with two copper wires, often called a local loop or a subscriber loop, or simply a loop. This a dedicated access circuit from the customer premise into the network. We usually have the same arrangement at the other end, with the far-end telephone in a different customer premise and the far-end telephone switch usually in a different central office.Copper is a good conductor of electricity - but not perfect: it has some resistance to the flow of electricity through it. Because of this, the signals on the loop diminish in intensity or attenuate with distance, and if the loop were too long, you wouldn't be able to hear the other person.The maximum resistance allowed is usually 1300 ohms, which works out to about 18,000 feet or 18 kft, which is 3 miles or 5 km on standard-thickness 26-gauge cable, but could be as long as 14 miles or 22 km on thicker 19-gauge cable.

    Thus, COs traditionally had a serving area of three miles radius around them, about 27 square miles or 75 square kms. With suburban sprawl, we can't build COs every five miles, so in practice, new subdivisions are served from remote switches, which are low-capacity switches in small huts or underground controlled environment vaults. The remote provides telephone service locally on the loops in the subdivision. The remote and the loops are connected back to the nearest CO via fiber or radio. Telephone switches are connected with trunks. While subscriber loops are dedicated access circuits, trunks are shared connections between COs. To establish a connection between one customer premise and another, the desired network address (telephone number) is signaled to the network (to the CO switch or remote) over the loop, then the switch seizes an unused trunk circuit going in the correct direction and the connects the loop to that trunk - for the duration of the call.When one end or the other hangs up, the trunk is released for someone else to connect between those two COs. This method for sharing the trunks is known as circuit switching. It was called dial-up when telephones had rotary dials. It is important to note that even though today there may be digital switching and digital transmission, the last 3 miles / 5 km of the network, the subscriber loop, most often still has its original characteristics, which date back to the late 1800s (!). Voice and data equipment that connects to the PSTN over regular telephone lines must work within the characteristics of the local loop, so an understanding of the characteristics and limitations of the local loop is essential.

Network topology:

The PSTN network architecture had to evolve over the years to support increasing numbers of subscribers, calls, connections to other countries, direct dialing and so on. The model developed by the United States and Canada was adopted by other nations, with adaptations for local markets. 

The original concept was that the telephone exchanges are arranged into hierarchies, so that if a call cannot be handled in a local cluster, it is passed to one higher up for onward routing. This reduced the number of connecting trunks required between operators over long distances and also kept local traffic separate. However, in modern networks the cost of transmission and equipment is lower and, although hierarchies still exist, they are much flatter, with perhaps only two layers. 


What Is Telecommunication?by Hoang Lihuo

    Telecommunications is a general term for a vast array of technologies that send information over distances. Mobile phones, land lines, satellite phones and voice over Internet protocol(VoIP) are all telephony technologies -- just one field of telecommunications. Radio, television and networks are a few more examples of telecommunication.

    The transmission media in telecommunication have evolved through numerous stages of technology, from beacons and other visual signals (such as smoke signals, semaphore telegraphs, signal flags and optical heliographs), to electrical cable and electromagnetic radiation, including light. Such transmission paths are often divided into communication channels, which afford the advantages of multiplexing multiple concurrent communication sessions. Telecommunication is often used in its plural form, because it involves many different technologies.