Follow this link to Chapter 10

Download Report

Transcript Follow this link to Chapter 10

Data and Computer
Communications
Chapter 10
Packet Switching
Basic Operation
Data transmitted in small packets
Longer messages split into series of packets
Each packet contains a portion of user data plus
some control info
Control info
Routing (addressing) info
Packets are received, stored briefly (buffered)
and past on to the next node
Store and forward operation
Use of Packets
Advantages
Line efficiency
Single node to node link can be shared by many
packets over time
Packets queued and transmitted as fast as possible
Data rate conversion
Each station connects to the local node at its own
speed
Nodes buffer data if required to equalize rates
Packets are accepted even when network is
busy
But delivery may slow down
Priorities can be used
Switching Technique
Station breaks long message into packets
Packets sent one at a time to the network
Packets handled in two ways
Datagram
Virtual circuit
Datagram
Each packet treated independently
Packets can take any practical route
Packets may arrive out of order
Packets may go missing
Up to receiver to re-order packets and recover
missing packets
Virtual Circuit
 Preplanned route established before any packets sent
 Call request and call accept packets establish connection
(handshaking) [Similar to circuit switching except that it
is done with packets rather than signals]
 Each packet contains a virtual circuit identifier instead of
destination address
 No routing decisions required for individual packets
 Clear request packet is used to drop circuit
 Not a dedicated path (unlike circuit switching, the path
may be shared)
Virtual Circuits versus
Datagram
Virtual circuits
Network can provide sequencing and error control
Packets are forwarded more quickly
No routing decisions to make
Less reliable
Loss of a node looses all circuits through that node
Datagram
No call setup phase
Better if few packets
More flexible
Routing can be used to avoid congested parts of the
network
Effect of Packet Size
on Transmission
Time
Small packet size
decreases total
transmission time;
but, there is a limit
to this approach
because of the
header. Here, d is
larger than c. So,
transmission time
starts to increase
again as a function
of header to data
ratio.
Circuit v Packet Switching
Performance; 3 types of delay may affect
performance:
Propagation delay: Time for a signal to propagate
from one node to another (mostly negligible)
Transmission time: Time for a transmitter to transmit
a block of data
Node delay: Node's data processing time (delay)
Event Timing
External and Internal Operation
 One of the most important characteristics of a packet switching network is whether it
uses datagrams or virtual circuits. There are 2 dimensions of this characteristic; one
for the interface between station and it corresponding network node (external), and
the other for the network itself (internal).
 Interface between station and network node
Connection oriented [External Virtual Circuit Service]
Station requests logical connection (virtual circuit)
All packets identified as belonging to that connection & sequentially
numbered
Network delivers packets in sequence
External virtual circuit service
e.g. X.25
Different from internal virtual circuit operation
Connectionless [External Datagram Service]
Packets handled independently
External datagram service
Different from internal datagram operation
Possible Combinations (1)
External virtual circuit, internal virtual circuit
Dedicated route through network
External virtual circuit, internal datagram
Network handles each packet separately
Different packets for the same external virtual circuit
may take different internal routes
Network buffers at destination node for re-ordering
Combinations (2)
External datagram, internal datagram
Packets treated independently by both network and
user
External datagram, internal virtual circuit
External user does not see any connections
External user sends one packet at a time
Network sets up logical connections
External
Virtual
Circuit and
Datagram
Operation
Internal
Virtual
Circuit and
Datagram
Operation
Routing
Complex, crucial aspect of packet switched
networks
Characteristics required
Correctness
Simplicity
Robustness
Stability
Fairness
Optimality
Efficiency
Performance Criteria
Used for selection of route and based on:
Minimum hop or:
Least cost
See Stallings appendix 10A for routing algorithms
Decision Time and Place
2 key characteristics concerned with routing
decisions are:
Decision Time
Packet or virtual circuit basis meaning decision is
made when packet is sent (datagram approach), or
when virtual circuit is set up
Decision Place
Distributed
Decision made by each node
Centralized
Decision made by a central network node
Source
Decision made by source
Network Information Source
and Update Timing
Routing decisions are usually (not not always)
based on knowledge of network
Distributed routing
Nodes use local knowledge
May collect info from adjacent nodes
May collect info from all nodes on a potential route
Central routing
Collect info from all nodes
Update timing
When is network info held by nodes, updated?
Fixed - never updated
Adaptive - regular updates
Routing Strategies
Fixed
Flooding
Random
Adaptive
Fixed Routing
Single permanent route for each source to
destination pair
Determine routes using a least cost algorithm
(appendix 10A)
Route fixed, at least until a change in network
topology happens
Fixed Routing
Tables
For each sourcedestination pair, the
routing table shows the
next node on the route.
Flooding
 No network info required
 Packet sent by node to every neighbor
 Incoming packets retransmitted on every link except incoming
link
 Eventually a number of copies will arrive at destination
 Each packet is uniquely numbered so duplicates can be
discarded
 Nodes can remember packets already forwarded to keep
network load in bounds
 Can include a hop count in packets
 Hop count is set to a maximum value. When packet passes a
node, it decrements the count. Packet is discarded if the count
reaches zero before reaching its destination
Flooding
Example
Properties of Flooding
All possible routes are tried
Very robust
At least one packet will have taken minimum
hop count route
Can be used to set up virtual circuit
All nodes are visited
Useful to distribute information (e.g. routing)
Random Routing
Node selects one outgoing path for
retransmission of incoming packet
Selection can be random or round robin
Can select outgoing path based on probability
calculation
No network info needed
Route is typically neither least cost nor minimum
hop
Adaptive Routing
Used by almost all packet switching networks
Routing decisions change as conditions on the
network change
Failure
Congestion
Requires info about network
Decisions are more complex
The tradeoff here is between quality of network
info and overhead associated with the time
involved in gathering the information, etc.
Adaptive Routing - Advantages
Improved performance
Aids in congestion control (covered in chapter
12)
X.25
Originally approved in 1976
Specifies interface between host and packet
switched network
Almost universal on packet switched networks
and packet switching in ISDN
Defines three layers
Physical
Link
Packet
X.25 - Physical Layer
Specifies interface between attached station and
link to node
Data terminal equipment DTE (user equipment)
Data circuit terminating equipment DCE (node)
Uses physical layer specification X.21, but often
other standards such as RS232 are used instead
Provides for a reliable transfer across physical
link by transmitting the data as a sequence of
frames
X.25 - Link Layer
Uses Link Access Protocol Balanced (LAPB)
Subset of HDLC
see LAPB frame structure (chapter 7 page 222) and
User Data and X.25 Control Information (chapter 10
page 331)
X.25 - Packet
Provides external virtual circuit service which
enables logical connections (virtual circuits)
between subscribers
X.25 Use of Virtual Circuits
Virtual Circuit Service
Provides for 2 types of virtual circuits:
Virtual Call
Dynamically established virtual circuits using a call
setup and call clearing procedure
Permanent virtual circuit
Fixed network assigned virtual circuit; data transfer
happens same way as virtual calls, but no call setup
and clearing is required.
Virtual Call
· See figure 10.16
and explanations on
pages 331-333
· Left side shows the
packets exchanged
between user
machine A and the
packet switching
node to which it is
attached
Packet Format (see Page 333)
Multiplexing
Most important service provided by X.25
Packets contain a 12 bit virtual circuit number
DTE is allowed to establish up to 4095 (212-1)
simultaneous virtual circuits with other DTEs
over a single DTC-DCE link
Number zero is reserved for diagnostic packets
common to all virtual circuits
The rest of the numbers are assigned by the
DCE or DTE depending on which one is initiating
the virtual circuit call
Virtual Circuit Numbering
Used when address
overflow from top
or bottom happens
Flow and Error Control
 Like HDLC (Chapter 7) using sliding window protocol [3
bit, 7 bit, or 15 bit sequence numbers] with:
 P(S)=Send sequence number and
 P(R)=Receive sequence number [number of next packet
expected from the other side]
 Acknowledgement has either local or end-to-end
significance.
 When D bit=0, acknowledgement is exercises between
DTE and the network.
 When D bit=1, acknowledgement is exercises between
DTE and the remote DTE
 The error control scheme is Go-Back-N ARQ
Packet Sequences
 X.25 provides the capacity to identify an adjacent sequence of data
packets, which is called a complete packet sequence
 This allows the network to form longer blocks of data sent across
network with smaller packet size without loss of block integrity
 To specify this mechanism, X.25 defines 2 types of packets:
 A packets
M bit 1 (means there are additional complete packets to follow),
D bit 0
 B packets
The rest (all other packets)
 In a complete packet sequence, there are zero or more A packets
followed by a B packet. The network may combine or break down
this sequence to make larger or smaller packets for transmission.
 See figure 10.19
Reset and Restart
Two methods that X.25 uses to recover from
errors are:
Reset
Reinitialize virtual circuit
Sequence numbers set to zero
Packets in transit lost
Up to higher level protocol to recover lost packets
Triggered by loss of packet, sequence number error,
congestion, loss of network internal virtual circuit
Restart
Equivalent to a clear request on all virtual circuits
E.g. temporary loss of network access