0% found this document useful (0 votes)
14 views

Module2 CN

The document discusses circuit switching and packet switching in computer networks. It provides examples of each type of switching and explains the key differences between them. Circuit switching establishes a dedicated path for communication between two endpoints, while packet switching breaks messages into packets that are sent individually and can arrive out of order.

Uploaded by

Gokul Gokul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Module2 CN

The document discusses circuit switching and packet switching in computer networks. It provides examples of each type of switching and explains the key differences between them. Circuit switching establishes a dedicated path for communication between two endpoints, while packet switching breaks messages into packets that are sent individually and can arrive out of order.

Uploaded by

Gokul Gokul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 51

Module 2

Circuit and Packet Switching

1
Internet as a black box
Application Application
Transport Transport
Network Network
Data link Message Message Data link
Physical Physical

Internet
A B

2
Internet as a combination of LANs and WANs connected together

3
NETWORK CONNECTING DEVICES

A Bridge is a device that connects two LANs and controls data
flow between them. A Switch is a networking device that
learns which machine is connected to its port by using the
device's IP Address. Bridges divide collision domain into two
parts. Bridges can create collision domains but not broadcast
domains.

4
• .

Switched Communications Networks


• the passage of a message from a source to a destination involves many
decisions
• When a message reaches a connecting device, a decision needs to be made to
select one of the output ports through which the packet needs to be send out.

• Types of switching to be discuss


• Circuit switching
• Packet Switching

5
Example for Circuit and Packet Switching
• A good example of a circuit-switched network is the early
telephone systems in which the path was established between
a caller and a callee when the telephone number of the callee
was dialed by the caller. When the callee responded to the call,
the circuit was established. The voice message could now flow
between the two parties, in both directions, while all of the
connecting devices maintained the circuit. When the caller or
callee hung up, the circuit was disconnected. The telephone
network is not totally a circuit-switched network today.
6
Example for Circuit and Packet Switching
• The network layer is designed as a packet-switched network.

• Individual datagrams are then transferred from the source to the destination.

• The received datagrams are assembled at the destination before recreating


the original message.

• The packet-switched network layer of the Internet was originally designed as


a connectionless service, but recently there is a tendency to change this to a
connection-oriented service.
7
Circuit Switching
• A circuit-switched network consists of a set of switches
connected by physical links. A connection between two
stations is a dedicated path made of one or more links.
• However, each connection uses only one dedicated channel on
each link. Each link is normally divided into n channels by using
FDM or TDM.

8
Circuit Switching

9
Circuit Switching
• Circuit switching takes place at the physical layer

• Before starting communication, the stations must make a reservation for the
resources to be used during the communication.

• Data transferred between the two stations are not packetized (physical layer
transfer of the signal). The data are a continuous flow sent by the source station
and received by the destination station, although there may be periods of silence.

• There is no addressing involved during data transfer. The switches route the data
based on their occupied band (FDM) or time slot (TDM). Of course, there is end-to-
end addressing used during the setup phase.
10
Circuit Switching- Phases
• The actual communication in a circuit-switched network
requires three phases: connection setup, data transfer, and
connection teardown.
• Setup Phase
• Data transfer Phase
• Tear down Phase

11
Circuit Switching- Technology in Telephone Networks
• The telephone companies have previously chosen the circuit
switched approach to switching in the physical layer; today the
tendency is moving toward other switching techniques.

• For example, the telephone number is used as the global


address, and a signaling system (called SS7) is used for the
setup and teardown phases.

12
Packet Switching

Network
A connectionless
packet-swtiched network
R1 R2

Sender Network

R4

R3 R5 Out of order Receiver

13
Packet Switching

• digital networking communications method that groups all transmitted data –


regardless of content, type, or structure – into suitably sized blocks, called packets.

• Packet switching features delivery of variable-bit-rate data streams (sequences of


packets) over a shared network.

• When traversing network adapters, switches, routers and other network nodes,
packets are buffered and queued, resulting in variable delay and throughput
depending on the traffic load in the network.

14
Packet Switching
• Packet switching contrasts with another principal networking
paradigm, circuit switching, a method which sets up a limited
number of dedicated connections of constant bit rate and constant
delay between nodes for exclusive use during the communication
session.

• In case of traffic fees (as opposed to flat rate), for example in


cellular communication services, circuit switching is characterized
by a fee per time unit of connection time, even when no data is
transferred, while packet switching is characterized by a fee per
unit of information.
15
Two major packet switching modes exist
1. Connectionless packet switching, also known as datagram switching
2. Connection-oriented packet switching, also known as virtual circuit
switching.
• In the first case each packet includes complete addressing or routing
information. The packets are routed individually, sometimes resulting in
different paths and out-of-order delivery. The forwarding decision is
based on the destination address of the packet
• In the second case a connection is defined and pre allocated in each
involved node during a connection phase before any packet is
transferred. The forwarding decision is based on the label of the packet.
16
Connectionless Packet Switching Network-
Datagram Switching
Network
A connectionless
packet-swtiched network
R1 R2
4 3 2 1 2

Sender 1
Network
4
2
3
R4 1
3 3
4 1 3 4 2
R3 R5 Out of order Receiver

17
Forwarding Process in Connectionless Network
Legend
Routing table
SA: Source address
DA: Destination address
Destination Output
address interface
A 1
B 2

H Send the packet


3 out of interface 2
Destination
address

SA DA Data SA DA Data
1 2

3 4

18
Delay in Connectionless
Souce Network Destination

Total delay
2

Time Time Time Time

19
A Connection Oriented Packet Switched
Network – Virtual Circuit Legend
4 3 2 1 Packets
Network
Virtual circuit
A connection-oriented
packet-switched network
R1 R2
4 3 2 1
Sender 4
R5
3 Network
2
1
4 3 2 1 4 3 2 1
R3 R4
Receiver

20
Forwarding Process in a Connection oriented
Network Routing Table
Incoming Outgoing
Legend
SA: Source address
Port Label Port Label DA: Destination address
1 L1 2 L2 L1, L2: Labels

L1 SA DA Data L2 SA DA Data
1 2

3 4
Incoming Outgoing
label label

21
Sending request packet in a virtual-circuit
network Incoming
A to B
Outgoing
Legend
A to B Request packet
Network Port Label Port Label
Virtual circuit
1 14 3

1 R2
R1 2
A to B
1 4
3
A
R5 Network
2 A to B

1 2 3 2 3 4
A to B A to B
3 1 4
R3 R4 B

Incoming Outgoing Incoming Outgoing


Port Label Port Label Port Label Port Label
1 66 3 1 22 4
A to B A to B
22
Setup acknowledgement in a virtual-circuit
network A to B Legend
Incoming Outgoing Acknowledge packet
Network Port Label Port Label Virtual circuit
1 14 3

4 R1 R2
2
14 4
1
3
A R5 Network
3 66 66

1 2 2 2 3 1
22 77
3 22 1 4
R3 R4 77
B

Incoming Outgoing Incoming Outgoing


Port Label Port Label Port Label Port Label
1 66 3 1 22 4
A to B A to B

23
Flow of one packet in an established virtual
circuit Incoming
A to B
Outgoing
Legend

A B Data Datagram
Port Label Port Label
Network 66 Virtual circuit
1 14 3

R1 R2
2
14 A B Data
1 4
A 3
R5 Network
66 A B Data

1 2 2 3
22 A B Data 77 A B Data
3 1 4
R3 R4

Incoming Outgoing Incoming Outgoing


Port Label Port Label Port Label Port Label
1 66 3 22 1 22 4 77
A to B A to B

24
Delay in a connection-oriented network
Source Destination

1
Setup

3
Total delay

Transmission
time
4

5
Teardown

Time Time Time Time

25
Comparison of Circuit Switching and Packet Switching
Parameter Circuit Switching Packet Switching
Routing scheme Route selected during call setup Each packet routed
independently
Multiplexing scheme Circuit multiplexing Packet multiplexing shared
media access networks
Addressing scheme Hierarchical numbering plan Hierarchical address space
Information representation Analog voice or PCM coded Binary information
voice
End terminal Telephone, modem Computer
Transmission system Analog and digital data over Digital data over different
different transmission media transmission media
Traffic Real time interactive Heavy traffic
Application Telephone network for bi- Internet for datagram and
directional, real time transfer of reliable stream service between
voice signals computers 26
Implementing Network Software
• Network architectures and protocol specifications are essential
things, but a good blueprint is not enough to explain the
phenomenal success of the Internet:
• some of the issues involved in implementing a network
application on top of the Internet , such programs are
simultaneously an application (i.e., designed to interact with
users) and a protocol (i.e., communicates with peers across the
network).

27
Implementing Network Software- Application
Programming Interface (Sockets)
• The place to start when implementing a network application is
the interface exported by the network.
• Since most network protocols are implemented in software
(especially those high in the protocol stack), and nearly all
computer systems implement their network protocols as part of
the operating system, when we refer to the interface “exported
by the network,” we are generally referring to the interface that
the OS provides to its networking subsystem. This interface is
often called the network application programming interface (API).
28
Implementing Network Software- Application
Programming Interface (Sockets)
• The main abstraction of the socket interface, not surprisingly, is
the socket. A good way to think of a socket is as the point
where a local application process attaches to the network.
• The interface defines operations for creating a socket,
attaching the socket to the network, sending/ receiving
messages through the socket, and closing the socket.

29
Implementing Network Software- Application
Programming Interface (Sockets)
• Socket creation Steps
• Step 1: create a socket, which is done with the following
operation:
int socket(int domain, int type, int protocol)
• Step 2 : depends on whether you are a client or a server. On a
server machine, the application process performs a passive
open the server says that it is prepared to accept
connections, but it does not actually establish a connection

30
Implementing Network Software- Application
Programming Interface (Sockets)
The server does this by invoking the following three operations:
• int bind(int socket, struct sockaddr *address, int addr len)
• int listen(int socket, int backlog)
• int accept(int socket, struct sockaddr *address, int *addr len)

31
Implementing Network Software- Application
Programming Interface (Sockets)
On the client machine, the application process performs an
active open; that is, it says who it wants to communicate with by
invoking the following single operation:
int connect(int socket, struct sockaddr *address, int addr len)

32
Implementing Network Software- Application
Programming Interface (Sockets)
Once a connection is established, the application processes
invoke the following two operations to send and receive data:
int send(int socket, char *message, int msg len, int flags)
int recv(int socket, char *buffer, int buf len, int flags)
The first operation sends the given message over the specified
socket, while the second operation receives a message from the
specified socket into the given buffer. Both operations take a set
of flags that control certain details of the operation

33
Networking Parameters(Transmission
Impairment, Data Rate and Performance)
Transmission Impairment
Signals travel through transmission media, which are not perfect.
The imperfection causes signal impairment. This means that the
signal at the beginning of the medium is not the same as the
signal at the end of the medium. What is sent is not what is
received. Three causes of impairment are attenuation, distortion,
and noise

34
Transmission Impairment - Attenuation
Attenuation means a loss of energy. When a signal, simple or composite,
travels through a medium, it loses some of its energy in overcoming the
resistance of the medium. That is why a wire carrying electric signals gets
warm, if not hot, after a while. Some of the electrical energy in the signal is
converted to heat. To compensate for this loss, amplifiers are used to amplify
the signal.
Decibel
To show that a signal has lost or gained strength, engineers use the unit of the
decibel. The decibel (dB) measures the relative strengths of two signals or one
signal at two different points. Note that the decibel is negative if a signal is
attenuated and positive if a signal is amplified.
35
Transmission Impairment - Attenuation

P2
dB  10 log10
P1
Variables PI and P2 are the powers of a signal at points 1 and 2, respectively.

36
Transmission Impairment - Attenuation
Example: Suppose a signal travels through a transmission
medium and its power is reduced to one-half. Find the
attenuation (loss of power).
Solution: dB=10 log (P/2P)= -3 dB
Example: A signal travels through an amplifier, and its power is
increased 10 times Find the amplification (gain of power).
Solution: dB=10 log (10P/P)= 10 dB

37
Transmission Impairment - Distortion
• Distortion means that the signal changes its form or shape.
• Distortion can occur in a composite signal made of different
frequencies. Each signal component has its own propagation speed
(see the next section) through a medium and, therefore, its own
delay in arriving at the final destination. Differences in delay may
create a difference in phase if the delay is not exactly the same as the
period duration.
• In other words, signal components at the receiver have phases
different from what they had at the sender. The shape of the
composite signal is therefore not the same
38
Transmission Impairment - Noise
• Noise is another cause of impairment. Several types of noise, such as
thermal noise, induced noise, crosstalk, and impulse noise, may
corrupt the signal. Thermal noise is the random motion of electrons in
a wire which creates an extra signal not originally sent by the
transmitter. Induced noise comes from sources such as motors and
appliances.
• To find the theoretical bit rate limit, we need to know the ratio of the
signal power to the noise power. The signal-to-noise ratio is defined
as:
SNR = average signal power/ average noise power
39
Data Rate
A very important consideration in data communications is how fast
we can send data, in bits per second over a channel. Data rate
depends on three factors:
1. The bandwidth available
2. The level of the signals we use
3. The quality of the channel (the level of noise) Two theoretical
formulas were developed to calculate the data rate: one by
Nyquist for a noiseless channel, another by Shannon for a noisy
channel.
40
Data Rate - Noiseless Channel: Nyquist Bit Rate

For a noiseless channel, the Nyquist bit rate formula defines the
theoretical maximum bit rate
BitRate = 2 x bandwidth x
In this formula, bandwidth is the bandwidth of the channel, L is
the number of signal levels used to represent data, and Bit Rate
is the bit rate in bits per second.

41
Data Rate - Noiseless Channel: Nyquist Bit Rate

Example:
Consider a noiseless channel with a bandwidth of 3000 Hz
transmitting a signal with two signal levels. The maximum bit rate
can be calculated as
BitRate =2 x 3000 x log2 2 =6000 bps

42
Data Rate - Noisy Channel: Shannon Capacity
In reality, we cannot have a noiseless channel; the channel is always noisy. In
1944, Claude Shannon introduced a formula, called the Shannon capacity, to
determine the theoretical highest data rate for a noisy channel:
Capacity =bandwidth X
In this formula, bandwidth is the bandwidth of the channel, SNR is the signal-
to-noise ratio, and capacity is the capacity of the channel in bits per second.
Note that in the Shannon formula there is no indication of the signal level,
which means that no matter how many levels we have, we cannot achieve a
data rate higher than the capacity of the channel. In other words, the formula
defines a characteristic of the channel, not the method of transmission.

43
Data Rate - Noisy Channel: Shannon Capacity
Example:
Consider an extremely noisy channel in which the value of the
signal-to-noise ratio is almost zero. In other words, the noise is so
strong that the signal is faint. For this channel the capacity C is
calculated as
C=B =B = B = B x 0 =0
This means that the capacity of this channel is zero regardless of
the bandwidth. In other words, we cannot receive any data
through this channel.
44
• Assume sender X is talking to receiver Y through a telephone
and the telephone line has a bandwidth of 4500 Hz for the
conversation. The Signal to Noise Ratio (SNR) is 6324 db.
Calculate the capacity of the telephone link.
• A. 57970 Mbps
• B. 55790 kbps
• C. 56790 bps
• D. 57790 Gbps

45
• Sender sends a message through a noiseless channel with a
bandwidth of 7000 Hz transmitting a signal with four signal
levels. The maximum bit rate can be calculated as
• A. 20000 bps
• B. 29000 bps
• C. 28000 bps
• D. 24000 bps

46
• Calculate the bit rate for noiseless channel with bandwidth of
1MHz and 4 signal levels
• A. 4Mbps
• B. 10Mbps
• C. 1Mbps
• D. 4kbps

47
• Telecom engineers on checking a channel identified a point
where there is a loss of half the signal power and it is
equivalent to
• A. Loss of 4dB
• B. Loss of 3dB
• C. Gain of 3dB
• D. Loss of 2dB

48
• Ravi and Sethu used a channel that has the bandwidth of 2MHz
and SNR of 127. The bit rate for the channel is
• A. 7Mbps
• B. 14Mbps
• C. 2Mbps
• D. 10Mbps

49
• Calculate the theoretical channel capacity where SNRis 27 dB
and bandwidth is 4MHz.
• A. 27Mbps
• B. 36Mbps
• C. 48Mbps
• D. 30Mbps

50
Thank You

51

You might also like