Unit 4
Switching and
Multiple Access
03/04/2017 Jitendra R Patil 1
Switching
• A switched network consists of a series of
interlinked nodes, called switches.
• Switches are devices capable of creating
temporary connections between two or more
devices linked to the switch.
• The mechanism for moving information between
different computer network and network
segment is called switching in computer
network.
03/04/2017 Jitendra R Patil 2
Switched Network
03/04/2017 Jitendra R Patil 3
Packet
• When transferring data across a network (e.g. the
internet), data is split into small bundles called
"packets".
• Each packet has:
• A label (a unique ID for the packet)
• A sequence number (where in the order it belongs)
• A Source Address (Where is from)
• A destination address (where it is being sent)
• A checksum no (to ensure no errors occurred during
transmission)
03/04/2017 Jitendra R Patil 4
Types of Switching
•Circuit Switching
•Packet Switching
•Message Switching
03/04/2017 Jitendra R Patil 5
Circuit Switching
• Circuit switching is a technique that directly
connects the sender and the receiver in an unbroken
path.
• Telephone switching equipment, for example,
establishes a path that connects the caller's
telephone to the receiver's telephone by making a
physical connection.
• With this type of switching technique, once a
connection is established, a dedicated path exists
between both ends until the connection is terminated
03/04/2017 Jitendra R Patil 6
03/04/2017 Jitendra R Patil 7
03/04/2017 Jitendra R Patil 8
Packet Switching
• In both packet switching methods, a
message is broken into small parts, called
packets.
• Each packet is tagged with appropriate
source and destination addresses.
•Each Packet is forwarded from switch to
switch
•Each Switching node has small amount of
buffer space to temporarily hold the
packets03/04/2017 Jitendra R Patil 9
03/04/2017 Jitendra R Patil 10
Two types of packet switching
•Virtual Circuit switching
•Datagram switching
03/04/2017 Jitendra R Patil 11
Virtual Circuit switching
03/04/2017 Jitendra R Patil 12
03/04/2017 Jitendra R Patil 13
DisconnectData
Connect Accept
Addressing
• A virtual-circuit network has two types of addressing:
Global Addressing
• Source or destination has An address which is unique in
the scope of network, it is used to create the virtual-
circuit identifier
Local Addressing (Virtual – Circuit identifier)
• It is a small no. that has only switch scope, its used by
the packet between two switches. When a packet
arrives at a switch, it has a VCI, when it leaves it has a
different VCI
03/04/2017 Jitendra R Patil 15
VCI(Virtual Circuit identifier)
03/04/2017 Jitendra R Patil 16
Source-to-destination data transfer in a
virtual-circuit network
03/04/2017 Jitendra R Patil 17
Datagram switching network
03/04/2017 Jitendra R Patil 18
A
B
Routing Table
03/04/2017 Jitendra R Patil 20
Message Switching
03/04/2017 Jitendra R Patil 21
Taxonomy of Multiple-access
Protocols
03/04/2017 Jitendra R Patil 22
03/04/2017 Jitendra R Patil 23
Pure ALOHA
03/04/2017 Jitendra R Patil 24
03/04/2017 Jitendra R Patil 25
If the first bit of a new frame overlaps with just
the last bit of a frame almost finished, both the
frames will be totally destroyed. It does not
distinguish between a total loss or a near miss.
03/04/2017 Jitendra R Patil 26
Slotted ALOHA
• Divide time up into discrete intervals, each
corresponding to one packet.
• The stations can only transmit data in one of
the time slots only.
• The vulnerable period is now reduced in half.
If the frames collide they will overlap
completely instead of partially.
Slotted ALOHA
03/04/2017 Jitendra R Patil 27
Problems:
Calculate the throughput S for pure ALOHA
network if the offer traffic G is 0.75
(Dec 2014, 4 M)
Solution :
S = G*e -2G
= 0.75*e -2*0.75
= 0.1673 or 16.73%
03/04/2017 Jitendra R Patil 28
• CSMA: Its concept is simply listen before talk
(LBT)
• If channel is sensed idle : transmit entire
frame
• If channel is sensed busy : defer transmission
• We could achieve better throughput if we
could listen to the channel before transmitting
a packet
• This way, we would stop avoidable collisions
• To do this, we need CSMA protocols
03/04/2017 Jitendra R Patil 29
CSMA (Carrier Sense Multiple Access)
There are several types of CSMA
protocols
03/04/2017 Jitendra R Patil 30
– 1-Persistent CSMA
– Non-Persistent CSMA
– P-Persistent CSMA
1-Persistent CSMA
Sense the channel
– If busy, keep listening to the channel and
transmit immediately when the channel becomes
idle
– If idle, transmit a packet immediately
• If collision occurs
– Wait a random amount of time and start over
again
- This protocol is called 1-persistent because the
host transmits with a probability of 1 whenever it
finds the channel idle03/04/2017 Jitendra R Patil 31
Non-Persistent CSMA
Sense the channel
– If busy, wait a random amount of time and sense
the channel again
– If idle, transmit a packet immediately
If collision occurs
– wait a random amount of time and start all over
again
Merits
• Better channel utilization
• Longer delays
• Reduces chances of collision
• Reduces efficiency03/04/2017 Jitendra R Patil 32
P-Persistent CSMA
• Applicable to slotted channels
• When a station becomes ready to send, it senses the
• channel
- if it is idle, station transmits with a probability of p
- it defers until next slot with a probability of q = 1-p
• If the slot is also idle
- either station transmits or it defers with
- probabilities of p & q
• This is repeated until either the frame has been
transmitted or another station begun transmitting
03/04/2017 Jitendra R Patil 33
Carrier sense multiple access with
collision detection
• Carrier Sense:- listen for traffic on medium and
determines gap between frames.
• Multiple Access:- Station can transmit any
time when find network quite.
• Collision Detection:- Occurs when two stations
transmits at same time. It gets detected and
transmit. Holds for random time.
03/04/2017 Jitendra R Patil 34
Carrier sense multiple access
with collision detection
CSMA/CD: carrier sensing, deferral as in CSMA
• collisions detected within short time
• colliding transmissions aborted, reducing channel
wastage
collision detection:
• easy in wired LANs: measure signal strengths,
compare transmitted, received signals
• difficult in wireless LANs: received signal strength
overwhelmed by local transmission strength
• human analogy: the polite conversationalist
03/04/2017 Jitendra R Patil 35
03/04/2017 Jitendra R Patil 36
Station is ready to
send
Station is
ready to
send
Station is ready to send
Transmit data
and sense
channel
(4)
Station is ready to
send
Transmit
jam signal
(5)
Station is ready to send
Wait according
to backoff
strategy
(6)Sense
chan
nel
(1)
Channel
free (2)
Channel
busy (3)
Collision detected
New attempt
controlled access protocol
• In controlled access, the stations consults each
other to find which station has right to send.
• Controlled access protocols grants permission to
send only one node at a time, to avoid collision of
messages on the shared medium.
• A station cannot send data unless it is authorized
by the other stations.
03/04/2017 Jitendra R Patil 37
Now we will discuss three named
controlled access methods.
1. Reservation.
Ex: cable modem, DQDB
2.Polling
Ex: HDLC(normal response mode)
3.Token Passing
Ex: Token Ring, Token Bus.
03/04/2017 Jitendra R Patil 38
1. Reservation.
• In the reservation method, a station needs to
make a reservation before sending data.
• Time is divided into intervals.
• In each interval, a reservation frame
precedes the data frames sent in that
interval
• If there are N stations in the system, there
are exactly N reservation mini slots in the
reservation frame.
03/04/2017 Jitendra R Patil 39
• a situation with five stations and a five minislot
reservation frame.
• Each mini slot belongs to a station. When a station
needs to send a data frame, it makes a reservation
in its own mini slot.
• The stations that have made reservations can send
their data frames after the reservation frame
03/04/2017 Jitendra R Patil 40
2.Polling
03/04/2017 Jitendra R Patil 41
• To impose order on a network of independent users
and to establish one station in the network as a
controller that periodically polls all other stations
which is called
• There are two general polling policies:
i. Round Robin Order
ii. Priority Order
2.Polling
• It works with topologies in which one device is
designated as a Primary Station and the other
devices are Secondary Stations.
• The Primary device controls the link, where as
the secondary follows it’s instructions.
• Exchange of data must be made through the
primary device even though the final
destination is secondary.
SELECT FUNCTION:
• Whenever primary has something to send, it sends the
message to each node.
• Before Sending the data, it creates and transmits a
Select(SEL) frame, one field of it includes the address
of the intended secondary.
• While sending, the primary should know whether the
target device is ready to receive or not.
• Hence, it alerts the secondary for the
upcoming transmission and wait for an
acknowledgement (ACK) of secondary’s
status.
POLL FUNCTION:
• When the primary is ready to receive data, it must
ask (poll) each device if it has anything to send.
• If the secondary has data to transmit, it sends the
data frame. Otherwise, it sends a negative
acknowledgement(NAK) .
• The primary then polls the next secondary. When
the response is positive (a data frame), the primary
reads the frame and returns an acknowledgment
(ACK).
• There are two possibilities to terminate the
transmission: either the secondary sends all data,
finishing with an EOT frame, or the primary says
timer is up.
Advantages:
• Priorities can be assigned to ensure faster
access from some secondary .
• Maximum and minimum access times and data
rates on the channel are predictable and fixed.
Drawbacks:
• High dependence on the reliability of the
controller.
• Increase in turn around time reduces the
channel data rate under low loads and it’s
throughput.
FEATURES:
• A Station is authorized to send data when it receives a
special frame called a Token.
• Stations are arranged around a ring (physically or
logically)
- A Token circulates around a ring
• If a station needs to send data ,it waits for the token
• The Station captures the token and sends one or more
frames as long as the allocated time has not expired
• It releases the token to be used by the successor station
Token
Station Interface is in two states :
o Listen state: Listen to the arriving bits and check the
destination address to see if it is its own address. If yes the
frame is copied to the station otherwise it is passed through
the output port to the next station.
o Transmit state: station captures a special frame called free
token and transmits its frames. Sending station is
responsible for reinserting the free token into the ring
medium and for removing the transmitted frame from the
medium.
bits are copied to the output bits
with a one bit delay Bits are inserted by the station
listen mode
1 bit delay
transmit mode
delay
to station from station
input
from
ring
output
to
ring
to station from station
Token
Passing
Flow Chart :

Unit 4

  • 1.
    Unit 4 Switching and MultipleAccess 03/04/2017 Jitendra R Patil 1
  • 2.
    Switching • A switchednetwork consists of a series of interlinked nodes, called switches. • Switches are devices capable of creating temporary connections between two or more devices linked to the switch. • The mechanism for moving information between different computer network and network segment is called switching in computer network. 03/04/2017 Jitendra R Patil 2
  • 3.
  • 4.
    Packet • When transferringdata across a network (e.g. the internet), data is split into small bundles called "packets". • Each packet has: • A label (a unique ID for the packet) • A sequence number (where in the order it belongs) • A Source Address (Where is from) • A destination address (where it is being sent) • A checksum no (to ensure no errors occurred during transmission) 03/04/2017 Jitendra R Patil 4
  • 5.
    Types of Switching •CircuitSwitching •Packet Switching •Message Switching 03/04/2017 Jitendra R Patil 5
  • 6.
    Circuit Switching • Circuitswitching is a technique that directly connects the sender and the receiver in an unbroken path. • Telephone switching equipment, for example, establishes a path that connects the caller's telephone to the receiver's telephone by making a physical connection. • With this type of switching technique, once a connection is established, a dedicated path exists between both ends until the connection is terminated 03/04/2017 Jitendra R Patil 6
  • 7.
  • 8.
  • 9.
    Packet Switching • Inboth packet switching methods, a message is broken into small parts, called packets. • Each packet is tagged with appropriate source and destination addresses. •Each Packet is forwarded from switch to switch •Each Switching node has small amount of buffer space to temporarily hold the packets03/04/2017 Jitendra R Patil 9
  • 10.
  • 11.
    Two types ofpacket switching •Virtual Circuit switching •Datagram switching 03/04/2017 Jitendra R Patil 11
  • 12.
  • 13.
  • 14.
  • 15.
    Addressing • A virtual-circuitnetwork has two types of addressing: Global Addressing • Source or destination has An address which is unique in the scope of network, it is used to create the virtual- circuit identifier Local Addressing (Virtual – Circuit identifier) • It is a small no. that has only switch scope, its used by the packet between two switches. When a packet arrives at a switch, it has a VCI, when it leaves it has a different VCI 03/04/2017 Jitendra R Patil 15
  • 16.
  • 17.
    Source-to-destination data transferin a virtual-circuit network 03/04/2017 Jitendra R Patil 17
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
    03/04/2017 Jitendra RPatil 25 If the first bit of a new frame overlaps with just the last bit of a frame almost finished, both the frames will be totally destroyed. It does not distinguish between a total loss or a near miss.
  • 26.
    03/04/2017 Jitendra RPatil 26 Slotted ALOHA • Divide time up into discrete intervals, each corresponding to one packet. • The stations can only transmit data in one of the time slots only. • The vulnerable period is now reduced in half. If the frames collide they will overlap completely instead of partially.
  • 27.
  • 28.
    Problems: Calculate the throughputS for pure ALOHA network if the offer traffic G is 0.75 (Dec 2014, 4 M) Solution : S = G*e -2G = 0.75*e -2*0.75 = 0.1673 or 16.73% 03/04/2017 Jitendra R Patil 28
  • 29.
    • CSMA: Itsconcept is simply listen before talk (LBT) • If channel is sensed idle : transmit entire frame • If channel is sensed busy : defer transmission • We could achieve better throughput if we could listen to the channel before transmitting a packet • This way, we would stop avoidable collisions • To do this, we need CSMA protocols 03/04/2017 Jitendra R Patil 29 CSMA (Carrier Sense Multiple Access)
  • 30.
    There are severaltypes of CSMA protocols 03/04/2017 Jitendra R Patil 30 – 1-Persistent CSMA – Non-Persistent CSMA – P-Persistent CSMA
  • 31.
    1-Persistent CSMA Sense thechannel – If busy, keep listening to the channel and transmit immediately when the channel becomes idle – If idle, transmit a packet immediately • If collision occurs – Wait a random amount of time and start over again - This protocol is called 1-persistent because the host transmits with a probability of 1 whenever it finds the channel idle03/04/2017 Jitendra R Patil 31
  • 32.
    Non-Persistent CSMA Sense thechannel – If busy, wait a random amount of time and sense the channel again – If idle, transmit a packet immediately If collision occurs – wait a random amount of time and start all over again Merits • Better channel utilization • Longer delays • Reduces chances of collision • Reduces efficiency03/04/2017 Jitendra R Patil 32
  • 33.
    P-Persistent CSMA • Applicableto slotted channels • When a station becomes ready to send, it senses the • channel - if it is idle, station transmits with a probability of p - it defers until next slot with a probability of q = 1-p • If the slot is also idle - either station transmits or it defers with - probabilities of p & q • This is repeated until either the frame has been transmitted or another station begun transmitting 03/04/2017 Jitendra R Patil 33
  • 34.
    Carrier sense multipleaccess with collision detection • Carrier Sense:- listen for traffic on medium and determines gap between frames. • Multiple Access:- Station can transmit any time when find network quite. • Collision Detection:- Occurs when two stations transmits at same time. It gets detected and transmit. Holds for random time. 03/04/2017 Jitendra R Patil 34
  • 35.
    Carrier sense multipleaccess with collision detection CSMA/CD: carrier sensing, deferral as in CSMA • collisions detected within short time • colliding transmissions aborted, reducing channel wastage collision detection: • easy in wired LANs: measure signal strengths, compare transmitted, received signals • difficult in wireless LANs: received signal strength overwhelmed by local transmission strength • human analogy: the polite conversationalist 03/04/2017 Jitendra R Patil 35
  • 36.
    03/04/2017 Jitendra RPatil 36 Station is ready to send Station is ready to send Station is ready to send Transmit data and sense channel (4) Station is ready to send Transmit jam signal (5) Station is ready to send Wait according to backoff strategy (6)Sense chan nel (1) Channel free (2) Channel busy (3) Collision detected New attempt
  • 37.
    controlled access protocol •In controlled access, the stations consults each other to find which station has right to send. • Controlled access protocols grants permission to send only one node at a time, to avoid collision of messages on the shared medium. • A station cannot send data unless it is authorized by the other stations. 03/04/2017 Jitendra R Patil 37
  • 38.
    Now we willdiscuss three named controlled access methods. 1. Reservation. Ex: cable modem, DQDB 2.Polling Ex: HDLC(normal response mode) 3.Token Passing Ex: Token Ring, Token Bus. 03/04/2017 Jitendra R Patil 38
  • 39.
    1. Reservation. • Inthe reservation method, a station needs to make a reservation before sending data. • Time is divided into intervals. • In each interval, a reservation frame precedes the data frames sent in that interval • If there are N stations in the system, there are exactly N reservation mini slots in the reservation frame. 03/04/2017 Jitendra R Patil 39
  • 40.
    • a situationwith five stations and a five minislot reservation frame. • Each mini slot belongs to a station. When a station needs to send a data frame, it makes a reservation in its own mini slot. • The stations that have made reservations can send their data frames after the reservation frame 03/04/2017 Jitendra R Patil 40
  • 41.
  • 42.
    • To imposeorder on a network of independent users and to establish one station in the network as a controller that periodically polls all other stations which is called • There are two general polling policies: i. Round Robin Order ii. Priority Order 2.Polling
  • 43.
    • It workswith topologies in which one device is designated as a Primary Station and the other devices are Secondary Stations. • The Primary device controls the link, where as the secondary follows it’s instructions. • Exchange of data must be made through the primary device even though the final destination is secondary.
  • 44.
    SELECT FUNCTION: • Wheneverprimary has something to send, it sends the message to each node. • Before Sending the data, it creates and transmits a Select(SEL) frame, one field of it includes the address of the intended secondary. • While sending, the primary should know whether the target device is ready to receive or not.
  • 45.
    • Hence, italerts the secondary for the upcoming transmission and wait for an acknowledgement (ACK) of secondary’s status.
  • 46.
    POLL FUNCTION: • Whenthe primary is ready to receive data, it must ask (poll) each device if it has anything to send. • If the secondary has data to transmit, it sends the data frame. Otherwise, it sends a negative acknowledgement(NAK) . • The primary then polls the next secondary. When the response is positive (a data frame), the primary reads the frame and returns an acknowledgment (ACK).
  • 47.
    • There aretwo possibilities to terminate the transmission: either the secondary sends all data, finishing with an EOT frame, or the primary says timer is up.
  • 48.
    Advantages: • Priorities canbe assigned to ensure faster access from some secondary . • Maximum and minimum access times and data rates on the channel are predictable and fixed. Drawbacks: • High dependence on the reliability of the controller. • Increase in turn around time reduces the channel data rate under low loads and it’s throughput.
  • 49.
    FEATURES: • A Stationis authorized to send data when it receives a special frame called a Token. • Stations are arranged around a ring (physically or logically) - A Token circulates around a ring • If a station needs to send data ,it waits for the token • The Station captures the token and sends one or more frames as long as the allocated time has not expired • It releases the token to be used by the successor station Token
  • 50.
    Station Interface isin two states : o Listen state: Listen to the arriving bits and check the destination address to see if it is its own address. If yes the frame is copied to the station otherwise it is passed through the output port to the next station. o Transmit state: station captures a special frame called free token and transmits its frames. Sending station is responsible for reinserting the free token into the ring medium and for removing the transmitted frame from the medium. bits are copied to the output bits with a one bit delay Bits are inserted by the station listen mode 1 bit delay transmit mode delay to station from station input from ring output to ring to station from station
  • 51.