You are on page 1of 72

Packet Switching

Around 1970, research began on a new form of architecture for long distance communications: Packet Switching.
1

Introduction
Packet Switching refers to protocols in which messages are divided into packets before they are sent. Each packet is then transmitted individually and can even follow different routes to its destination. Once all the packets forming a message arrive at the destination, they are recompiled into the original message.

Packet Switching Application


Most modern Wide Area Network (WAN) protocols, including TCP/IP, X.25, and Frame Relay, are based on packet-switching technologies. In contrast, normal telephone service is based on a circuit-switching technology, in which a dedicated line is allocated for transmission between two parties. Circuit-switching is ideal when data must be transmitted quickly and must arrive in the same order in which it's sent. This is the case with most real-time data, such as live audio and video. Packet switching is more efficient and robust for data that can withstand some delays in transmission, such as e-mail messages and Web pages.
3

Recall Circuit Switching


Call Set-up Data Transfer Call disconnect

Features of Circuit Switching


Circuit switching is connection oriented. Resources are allocated for the call throughout the network. Calls may be blocked if the resources are not available. Circuit Switching originated due to need for voice communications.

Circuit Switching for Data


When Circuit Switching networks started to be used for data communications it became clear that: In circuit switching resources dedicated to a particular call whereas data traffic is bursty so most of the time allocated resources would be unutilized. Data rate is fixed in circuit switching so both ends must operate at the same rate - whereas there is asymmetry in the data rate required for each communicating party for data communication needs.
6

Packet Switching
Packet Switching started in the 1970s. ARPANET that became Internet In the beginning most people did not believe it would work The basic technology of packet switching is fundamentally the same today as it was in the early 1970s networks Packet switching remains one of the few technologies for effective long-distance data communications. 7

Packet Switching Operation


Data are transmitted in short packets. Typically an upper bound on packet size is 1000 octets. If a station has a longer message to send it breaks it up into a series of small packets. Each packet now contains part of the user's data and some control information. The control information should at least contain: Destination Address Source Address Store and forward - Packets are received, stored briefly (buffered) and past on to the next node

Packet Switching Operation

Use of Packets

10

Packet Switching Networks are Switched Networks

11

Advantages
Line efficiency Single node to node link can be dynamically shared by many packets over time Packets queued and transmitted as fast as possible Data rate conversion Two stations of different data rates can exchange packets because each connects to its node at its proper data rate
12

Advantages
When traffic becomes heavy in a circuit switching network, some calls are blocked i.e the network refuses to accept additional connection requests until the load on the network decreases. On a packet switching network, packets are still accepted, but delivery delay increases Priorities can be used. If a node has a number of packets queued for transmission, it can transmit the higher priority packets first.
13

Switching Technique
If a station sends a message through packet switching network that is of length greater than the maximum packet size, it breaks the message up into packets and sends these packets, one at a time, to the network Question?? How the network will handle this stream of packets as it attempts to route them through the network and deliver them to the intended destination
14

Switching Technique - Virtual Circuits and Datagrams


Packets handled in two ways
Datagram approach Virtual circuit approach

15

Datagram Packet Switching


In datagram approach each packet is treated independently with no reference to packets that have gone before. No connection is set up. 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 from missing packets More processing time per packet per node Robust in the face of link or node failures.
16

Packet Switching Datagram Approach

17

Virtual Circuit Packet Switching


In the Virtual Circuit approach a pre-planned route is established before any packets are sent. There is a call set up before the exchange of data (handshake). All packets follow the same route and therefore arrive in sequence. Each packet contains a virtual circuit identifier instead of destination address More set up time
18

Virtual Circuit Packet Switching


No routing decisions required for each packet - Less routing or processing time Susceptible to data loss in the face of link or node failure Clear request to drop circuit Not a dedicated path

19

Packet Switching Virtual Circuit Approach

20

Virtual Circuit

21

One Station Can Have Many Virtual Circuit Connections

22

Virtual Circuits vs. Datagram


So the main characteristic of the virtual circuit technique is that a route between stations is setup prior to data transfer, this does not mean that this is a dedicated path as in the circuit switching A packet is still buffered at each node, and queued for output over a line, while other packets on other virtual circuits may share the use of the line
23

Virtual Circuits vs. Datagram


Virtual circuits
Network can provide sequencing and error control Packets are forwarded more quickly Less reliable
No routing decisions to make Loss of a node looses all circuits through that node

Datagram

No call setup phase


More flexible

Better if few packets Routing can be used to avoid congested parts of the network

24

Packet Size

25

Packet Size
In this example it is assumed that there is a virtual circuit from station X through nodes a and b to station Y. The message to be sent comprises 40 octets and 3 octets of control information called header. If the entire message is sent the packet first transmitted from station X to node a, when the entire packet is received, it can be transmitted from a to b and then transmitted to Y. ignoring switching time, total transmission time is 129 octettime(43octets x 3 packet transmission)
26

Circuit vs. Packet Switching


Performance
Propagation delay
The time it takes a signal to propagate from one node to the next. This time generally negligible. Typically on a wire medium 2x108

Transmission time
The time it takes for a transmitter to send out a block of data, e.g it takes 1s to transmit 10,000 bit block of data onto a 10-kbps line.

Node delay
The time it takes for a node to perform the necessary processing as it switches data 27

Comparison with Circuit Switching - Event Timing

28

Circuit Switching
Datagram Packet switching
Dedicated transmission path Continuous transmission of data Fast enough for interactive Messages are not stored The path is established for entire conversation Call setup delay; negligible transmission delay Busy signal if called party busy Overload may block call setup; no delay for established calls Electromechanical or computerized switching User responsible for message loss protection Usually no speed or code conversion Fixed bandwidth No overhead bits after call setup No dedicated path

Packet Switching
Virtual-circuit Packet Switching
No dedicated path Transmission of packets Fast enough for interactive Packets stored until delivered Route established for entire conversation Call setup delay; packet transmission delay Sender notified of connection denial Overload may block call setup; increase packet delay Small switching nodes Network may be responsible for packet sequences Speed and code conversion Dynamic use of bandwidth Overhead bits in each packet

Transmission of packets Fast enough for interactive Packets may be stored until delivered Route established for each packet Packet transmission delay Sender may be notified if packet not delivered Overload increases packet delay Small switching nodes Network may be responsible for individual packets Speed and code conversion Dynamic use of bandwidth Overhead bits in each packet

29

Packet switching datagrams or virtual circuits


Interface between station and network node
Connection oriented
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 Packets handled independently External datagram service Different from internal datagram operation
30

Connectionless

Combinations (1)
External virtual circuit, internal virtual circuit When the user requests a virtual circuit, a dedicated route through the network is constructed. All packets follow the same route 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
31

Combinations (2)
External datagram, internal datagram Each packets is treated independently from both the users and the networks point of view External datagram, internal virtual circuit External user does not see any connections simply sending packets one at a time Network sets up logical connection between stations for packet delivery

32

External Virtual Circuit and Datagram Operation

33

Internal Virtual Circuit and Datagram Operation

34

External and Internal Operation - ED/IVC

35

External and Internal Operation - ED/ID

36

External and Internal Operation - EVC/IVC

37

External and Internal Operation - EVC/ID

38

Packet switching - datagram v/s virtual circuits


The datagram service, coupled with internal datagram operation, allows for efficient use of the network There is no call setup and no need to hold up packets while a packet in error is retransmitted The virtual circuit service can provide end-toend sequencing and error control
39

Packet switching - datagram v/s virtual circuits


virtual circuit is attractive for supporting connection-oriented applications such as file transfer and remote terminal access In practice, the virtual circuit service is much more common than the datagram service The reliability and convenience of a connection-oriented service is seen as more attractive than the benefits of the datagram service
40

Routing
Complex, crucial aspect of packet switched networks Characteristics required
Correctness Simplicity Robustness Stability Fairness Optimality Efficiency

41

Routing Performance Criteria


The selection of a route is generally based on some performance criterion. Minimum hop Least cost Routing
Cost is associated with each link Cost could be inversely related to the data rate Using some algorithm

Delay Throughput
42

Routing Decision Time and Place


Routing decisions are made on the basis of some performance criterion. Two key characteristics of the decision are the time and place that the decision is made. Decision time is determined by whether the routing decision is made on a packet or virtual circuit basis. When the internal operation of the network is datagram, a routing decision is made individually for each packet. For the internal virtual circuit operation, a routing decision is made at the time the virtual circuit is established
43

Routing Decision Time and Place


The term decision place refers to which node or nodes in the network are responsible for the routing decision.
Distributed
Made by each node (more complex but more robust)

Centralized (network control centre)


Loss of the control centre may block operation of the network

Source routing
(decision is actually made by the source station rather than by a network node)
44

Network Information Source


Routing decisions usually based on knowledge of network (not always) Some strategies use no such information and yet manage to get packets through; flooding and some random strategies Distributed routing
Nodes use local knowledge May collect info from adjacent nodes May collect info from all nodes on a potential route

Central routing
Central node collect info from all nodes
45

Network Information Update Timing


A related concept is that of information update timing
Which is a function of both the information source and the routing strategy If no information is used (as in flooding), there is no information to update Fixed strategy information is never updated Adaptive strategy information is updated from time to time to enable the routing decision to adapt to changing decision (regular updates)
46

Elements of Routing Techniques for Packet-Switching Networks


Performance Criteria
Number of Hops Cost Delay Throughput

Network Information Source


None Local Adjacent node Node along route All nodes

Decision time
Packet (Datagram) Session (Virtual Circuit)

Network information update


Continuous Periodic Major load change Topology change

Decision Place
Each node (distributed) Central node (Centralized) Originating node (Source)

47

Routing Strategies
Fixed Flooding Random Adaptive

48

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

49

Fixed Routing Tables

50

Fixed Routing
With fixed routing, there is no difference between routing for datagrams and virtual circuits All packets from a given source to a given destination follow the same route The advantage of fixed routing is simplicity and it should work well in a reliable network with a stable load Its disadvantage is its lack of flexibility. It does not react to network congestion or failures 51

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 52

Flooding Example

53

Properties of Flooding
All possible routes between source and destination are tried
Very robust (used to send emergency messages)

Because all routes are tried at least one copy of the packet to arrive at the destination will have used a minimum hop route All nodes are visited
Useful to distribute information (e.g. routing)

The principal disadvantage of flooding is the high traffic load 54

Random Routing
Random routing has the simplicity and robustness of flooding with far less traffic load 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 not least cost nor minimum hop
55

Adaptive Routing
Used by almost all packet switching networks Routing decisions change as conditions on the network change Failure
When a node or trunk fails, it can no longer be used as part of a route

Congestion
Portion of a network is heavily congested, packets route around rather than the area of congestion

Requires info about network Decisions more complex (processing burden on network nodes increases)
56

Adaptive Routing - Advantages


Reacting too quickly, causing congestionproducing oscillation, or too slowly, being irrelevant Improved performance, as seen by the network user An adaptive routing strategy can aid in congestion control

57

ARPANET Routing Strategies(1)


First Generation 1969 Distributed adaptive Estimated delay as performance criterion Bellman-Ford algorithm Node exchanges delay vector with neighbors Update routing table based on incoming info Doesn't consider line speed, just queue length Queue length not a good measurement of delay Responds slowly to congestion
58

ARPANET Routing Strategies(2)


Second Generation 1979
Uses delay as performance criterion Delay measured directly Uses Dijkstras algorithm Good under light and medium loads Under heavy loads, little correlation between reported delays and those experienced

59

ARPANET Routing Strategies(3)


Third Generation
1987 Link cost calculations changed Measure average delay over last 10 seconds Normalize based on current value and previous results

60

Costing of Routes

61

Dijkstras Algorithm
Define:
N = set of all nodes in the network s = source node M = set of nodes so far incorporated by the algorithm dij = link cost from node i to node j; dii = 0 and dij = if the two nodes are not directly connected; dij 0 if the two nodes are directly connected Dn = cost of the least cost path from node s to node n that is currently known to the algorithm
62

Costing of Routes

Dijkstras Algorithm
Steps 1. Initialize: this is done once in the beginning = {s} M i.e. set of nodes incorporated is only the source node n = dsn for n s i.e. initial path costs to neighboring nodes are simply link D
costs

2. Find the neighboring node not in M that has the least cost path from node s and incorporate that node into M: Find w M such that Dw = min Dj ( j M) Add w to M
53 55

Dijkstras Algorithm
Define: N = set of all nodes in the network s = source node M = set of nodes so far incorporated by the

Dijkstras Algorithm
3. Update least-cost paths: D n = min[D n, Dw +dwn] for all n M If the latter term is the minimum, the path from s to n is now the path from s to w concatenated with the link from w to n

algorithm dij = link cost from node i to node j; dii = 0 and dij = if the two nodes are not directly connected; dij 0 if the two nodes are directly connected Dn = cost of the least cost path from node s to node n that is currently known to the algorithm

54

63

56

Example Algorithm Dijkstra

64

Results for Dijkstra Algorithm


It er ati on T L(2) Path L(3) Path L(4) Path L(5) Path L(6 ) Path

1
2 3 4

{1}
{1,4} {1, 2, 4} {1, 2, 4, 5} {1, 2, 3, 4, 5}

2
2 2 2

12
12 12 12

5
4 4 3

1-3
1-4-3 1-4-3 1-4-5 3 1-4-5 3

1
1 1 1

14
14 14 14

2 2 2

1-45 1-45 1-45

1-4-56

12

14

1-45

1-4-56

65

Bellman-Ford Algorithm Definitions


Find shortest paths from given node subject to constraint that paths contain at most one link Find the shortest paths with a constraint of paths of at most two links And so on s = source node w(i, j) = link cost from node i to node j w(i, i) = 0 w(i, j) = if the two nodes are not directly connected w(i, j) 0 if the two nodes are directly connected h = maximum number of links in path at current stage of the algorithm Lh(n) = cost of least-cost path from s to n under constraint of 66 no more than h links

Example of Bellman-Ford Algorithm

67

Results of Bellman-Ford Example


h Lh(2 Pat Lh(3 Path ) h ) Lh(4 Pat Lh(5 Path Lh(6 Path ) h ) )

0
1 2 2 2 3 2 4 2

1-3 1-4-3

1 1

1-3-6 1-4-5-6 1-4-5-6


68

1-2 5 1-2 4 1-2 3 1-2 3

1-4 1-4 2 1-4 2 1-4 2

1-4- 10 5 1-4- 4 5 1-4- 4 5

1-4-5- 1 3 1-4-5- 1 3

Comparison
Results from two algorithms agree Information gathered
Bellman-Ford
Calculation for node n involves knowledge of link cost to all neighboring nodes plus total cost to each neighbor from s Each node can maintain set of costs and paths for every other node Can exchange information with direct neighbors Can update costs and paths based on information from neighbors and knowledge of link costs

Dijkstra
Each node needs complete topology Must know link costs of all links in network Must exchange information with all other nodes

69

Evaluation
Dependent on processing time of the algorithms and the amount of information that must be collected from other nodes in the network The evaluation will be depend on the implementation approach and the specific implementation Both algorithms are known to converge under static conditions of topology and link costs and will converge to the same solution If the link costs change over time, the algorithms will attempt to catch up with these changes However, if the link costs depend on traffic, which in turn depends on routes chosen, then a feedback conditions exists, and instabilities may result
70

Packet Switching Evolution


X.25 packet-switched network Router-based networking Switching vs. routing Frame relay network ATM network

71

Switching v/s Routing


Switching path set up at connection time simple table look up table maintainance via signaling no out of sequence delivery lost path may lose connection much faster than pure routing link decision made ahead of time, and resources allocated then Routing can work as connectionless complex routing algorithm table maintainance via protocol out of sequence delivery likely robust: no connections lost significant processing delay output link decision based on packet header contents - at every node 72

You might also like