Thursday, December 4, 2008

Circuit Switching vs. Packet Switching

The old telephone system (PSTN) uses circuit switching to transmit voice data whereas VoIP uses packet-switching to do so. The difference in the way these two types of switching work is the thing that made VoIP so different and successful.

To understand switching, you need to realize that the network in place between two communicating persons is a complex field of devices and machines, especially if the network is the Internet. Consider a person in Mauritius having a phone conversation with another person on the other side of the globe, say in the US. There are a large number of routers, switches and other kinds of devices that take the data transmitted during the communication from one end to the other.

Switching and routing

Switching and routing are technically two different things, but for the sake of simplicity, let us take switches and routers (which are devices that make switching and routing respectively) as devices doing one job: make a link in the connection and forward data from the source to the destination.

Paths or circuits

The important thing to look for in transmitting information over such a complex network is the path or circuit. The devices making up the path are called nodes. For instance, switches, routers and some other network devices, are nodes.

In circuit-switching, this path is decided upon before the data transmission starts. The system decides on which route to follow, based on a resource-optimizing algorithm, and transmission goes according to the path. For the whole length of the communication session between the two communicating bodies, the route is dedicated and exclusive, and released only when the session terminates.


Packets

To be able to understand packet-switching, you need to know what a packet is. The Internet Protocol (IP) , just like many other protocols, breaks data into chunks and wraps the chunks into structures called packets. Each packet contains, along with the data load, information about the IP address of the source and the destination nodes, sequence numbers and some other control information. A packet can also be called a segment or datagram.

Once they reach their destination, the packets are reassembled to make up the original data again. It is therefore obvious that, to transmit data in packets, it has to be digital data.

In packet-switching, the packets are sent towards the destination irrespective of each other. Each packet has to find its own route to the destination. There is no predetermined path; the decision as to which node to hop to in the next step is taken only when a node is reached. Each packet finds its way using the information it carries, such as the source and destination IP addresses.

As you must have figured it out already, traditional PSTN phone system uses circuit switching while VoIP uses packet switching.

Brief comparison

  • Circuit switching is old and expensive, and it is what PSTN uses. Packet switching is more modern.
  • When you are making a PSTN call, you are actually renting the lines, with all it implies. See why international calls are expensive? So if you speak for, say 10 minutes, you pay for ten minutes of dedicated line. You normally speak only when your correspondent is silent, and vice versa. Taking also into consideration the amount of time no one speaks, you finally use much less than half of what you are paying for. With VoIP, you actually can use a network or circuit even if there are other people using it at the same time. There is no circuit dedication. The cost is shared.
  • Circuit-switching is more reliable than packet-switching. When you have a circuit dedicated for a session, you are sure to get all information across. When you use a circuit which is open for other services, then there is a big possibility of congestion (which is for a network what a traffic jam is for the road), and hence the delays or even packet loss. This explains the relatively lower quality of VoIP voice compared to PSTN. But you actually have other protocols giving a helping hand in making packet-switching techniques to make connections more reliable. An example is the TCP protocol. Since voice is to some extent tolerant to some packet loss (unless text - since a comma lost can mean a big difference), packet-switching is finally ideal for VoIP.

http://classes.maxwell.syr.edu/psc300_103/Circuit%20Packet%20Switching.jpg

Various Switching Techniques

Circuit switching

In telecommunications, a circuit switching network is one that establishes a fixed bandwidth circuit (or channel) between nodes and terminals before the users may communicate, as if the nodes were physically connected with an electrical circuit.

The bit delay is constant during a connection, as opposed to packet switching, where packet queues may cause varying delay. Each circuit cannot be used by other callers until the circuit is released and a new connection is set up. Even if no actual communication is taking place in a dedicated circuit that channel remains unavailable to other users. Channels that are available for new calls to be set up are said to be idle.

Virtual Circuit Switching is a packet switching technology that may emulate circuit switching, in the sense that the connection is established before any packets are transferred, and that packets are delivered in order.

There is a common misunderstanding that circuit switching is used only for connecting voice circuits (analog or digital). The concept of a dedicated path persisting between two communicating parties or nodes can be extended to signal content other than voice. Its advantage is that it provides for non-stop transfer without requiring packets and without most of the overhead traffic usually needed, making maximal and optimal use of available bandwidth. The disadvantage of inflexibility tends to reserve it for specialized applications, particularly with the overwhelming proliferation of internet-related technology.

http://www.h3c.com/portal/res/200701/18/20070118_23961_image013_1b7222f9-9c6e-4c17-bb3e-bad94839d61c__0.gif

Examples of circuit switched networks

  • Public Switched Telephone Network(PSTN)
  • ISDN B-Channel
  • Circuit Switched Data(CSD) and High Speed Circuit Switched Data in a cellular system such as GSM
  • X.21
Compared to datagram packet switching

Since the first days of the telegraph it has been possible to mutiplex multiple connections over the same physical conductor, but nonetheless each channel on the multiplexed link was either dedicated to one call at a time, or it was idle between calls.

With circuit switching, and virtual circuit switching, a route is reserved from source to destination. The entire message is sent in order so that it does not have to be reassembled at the destination. Circuit switching can be relatively inefficient because capacity is wasted on connections which are set up but are not in continuous use (however momentarily). On the other hand, the connection is immediately available and capacity is guaranteed until the call is disconnected.

Circuit switching contrasts with packet switching which splits traffic data (for instance, digital representation of sound, or computer data) into chunks, called packets, that are routed over a shared network.

Packet switching is the process of segmenting a message/data to be transmitted into several smaller packets. Each packet is labeled with its destination and the number of the packet, precluding the need for a dedicated path to help the packet find its way to its destination. Each is dispatched and many may go via different routes. At the destination, the original message is reassembled in the correct order, based on the packet number. Datagram packet switching networks do not require a circuit to be established and allow many pairs of nodes to communicate almost simultaneously over the same cha

Packet switching

Packet switching is a network communications method that splits data traffic (digital representations of text, sound, or video data) into chunks, called packets, that are then routed over a shared network. To accomplish this, the original message/data is segmented into several smaller packets. Each packet is then labeled with its destination and the number of the packet. This precludes the need for a dedicated path to help the packet find its way to its destination. Each packet is dispatched and may go via different routes. At the destination, the original message/data is reassembled in the correct order, based on the packet number and other statistically determined factors. In each network node, packets are queued or buffered, resulting in variable delay. This contrasts with the other principal paradigm, circuit switching, which sets up a specific circuit with a limited number of constant bit rate and constant delay connections between nodes for exclusive use during the communication session.

Packet mode or packet-oriented communication may be utilized with or without a packet switch, in the latter case directly between two hosts. Examples of that are point-to-point data links, digital video and audio broadcasting or a shared physical medium, such as a bus network, ring network, or hub network.

http://giat501.files.wordpress.com/2008/06/packet-switching.gif

Message switching

In telecommunication, message switching was the precursor of packet switching, where messages were routed in their entirety, one hop at a time. It was first introduced by Leonard Kleinrock in 1961. Message switching systems are nowadays mostly implemented over packet-switched or circuit-switched data networks.

Examples

Hop-by-hop Telex forwarding and UUCP are examples of message switching systems. E-mail is another example of a message switching system.

When this form of switching is used, no physical path is established in advance in between sender and receiver. Instead, when the sender has a block of data to be sent, it is stored in the first switching office (i.e. router) then forwarded later at one hop at a time. Each block is received in its entity form, inspected for errors and then forwarded or re-transmitted.


A form of store-and-forward network. Data is transmitted into the network and stored in a switch. The network transfers the data from switch to switch when it is convenient to do so, as such the data is not transferred in real-time. Blocking can not occur, however, long delays can happen. The source and destination terminal need not be compatible, since conversions are done by the message switching networks.

A message switch is “transactional”. It can store data or change its format and bit rate, then convert the data back to their original form or an entirely different form at the receive end. Message switching multiplexes data from different sources onto a common facility.

http://homepages.ius.edu/rwisman/B438/HTML/ch2_12.jpg

Store and forward delays

Since message switching stores each message at intermediate nodes in its entirety before forwarding, messages experience an end to end delay which is dependent on the message length, and the number of intermediate nodes. Each additional intermediate node introduces a delay which is at minimum the value of the minimum transmission delay into or out of the node. Note that nodes could have different transmission delays for incoming messages and outgoing messages due to different technology used on the links. The transmission delays are in addition to any propagation delays which will be experienced along the message path.

In a message-switching centre an incoming message is not lost when the required outgoing route is busy. It is stored in a queue with any other messages for the same route and retransmitted when the required circuit becomes free. Message switching is thus an example of a delay system or a queuing system. Message switching is still used for telegraph traffic and a modified form of it, known as packet switching, is used extensively for data communications.