1 Chap. 9 Packet Switching 1. Packet-Switching Principles • Store & forward scheme – message is split into size-limited packets for transmission • Pipelining of packet transmission reduces transmission delay • Advantages over circuit-switching – Greater line efficiency due to sharing of line capacity – Sender and receiver do not need to be simultaneously ready – Message prioritization easy – Data-rate conversion possible • Two schemes for packet switching are – Datagrams: each packet is individually routed through network – Virtual circuits: a virtual circuit is first established; all packets then follow this path, one following the other – Datagram • Better flow balancing • No call-setup phase • More flexible • More reliable – Virtual circuit • Easier error & flow control • Small packet headers ⇒ more efficient use of bandwidth for interactive, small packet traffic
2 Chap. 9 Packet Switching • Relationship between packet size and trans. time
3 Chap. 9 Packet Switching • Comparison of circuit switching and packet switching
4 Chap. 9 Packet Switching Datagram packet Virtual-circuit switching packet switching Circuit switching Dedicated transmission path No dedicated path No dedicated path Continuous transmission of Transmission of packets Transmission of packets data Fast enough for interactive Fast enough for interactive Fast enough for interactive Messages are not stored Packets may be stored Packets stored until until delivered delivered The path is established for Route established for Route established for entire conversation each packet entire conversation Call setup delay; negligible Packet transmission delay Call setup delay; packet transmission delay transmission delay Busy signal if called party Sender may be notified if Sender notified of busy packet not delivered connection denial Overload may block call Overload increases Overload may block call setup; no delay for packet delay setup; increases packet established calls delay Electromechanical or Small switching nodes Small switching nodes computerized switching nodes User responsible for Network may be responsi- Network may be responsi- message loss protection ble for individual packets ble for individual packets Usually no speed or code Speed and code conversion Speed and code conversion conversion Fixed bandwidth Dynamic use of bandwidth Dynamic use of bandwidth transmission No overhead bits after call Overhead bits in each Overhead bits in each setup packet packet
5 Chap. 9 Packet Switching • External and Internal Operation – Externally, to the user a PSN may appear as a datagram (connectionless) or VC (connection-oriented) service; its internal structure can be different from the external structure. – External view: interface between host and PSN – Internal view: operations inside PSN (a)External virtual circuit. A logical connection is set up between two stations. Packets are labeled with a virtual circuit number and a sequence number. Packets arrive in sequence. (b)External datagram. Each packet is labeled with a destination address and may arrive out of sequence.
6 Chap. 9 Packet Switching • Virtual circuit service (external view) – Packets are delivered error-free and in sequence – Provide flow and error control – (Most network applications demand sequential, error- free, flow controlled service) (c) Internal virtual circuit. A route for packets between two stations is defined and labeled. All packets for that virtual circuit follow the route and arrive in sequence. (d) Internal datagram. Each packet is treated independently by the network and may arrive at the destination out of sequence.
7 Chap. 9 Packet Switching • Datagram service (external view) – Packets may arrive out of sequence, be damaged, be duplicated, or be lost. – No flow and error control – Higher throughput – (For some applications, efficiency is more important than an occasional erroneous or omitted packet. For some applications (e.g., credit checking, banking) higher level protocol will implement flow and error control anyway. Virtual circuit just introduces unnecessary redundancy.) • Virtual circuit operation (internal view) – Connection establishment (make routing decision only once) – Minimize per-packet overhead (only need virtual circuit number in every packet) – The failure of a node or link could destroy some virtual circuits • Datagram operation (internal view) – No connection establishment (each packet is delivered independently) – High bandwidth overhead (full destination address in every packet) – More flexible: react more quickly to traffic condition by making routing decisions on a per-packet basis – More robust: if nodes or links are failed, packets can be routed around the affected area
8 Chap. 9 Packet Switching 2. ROUTING – In a packet switched network, need to determine a path to get from a sender to a destination; usually multiple paths exist, so need to choose one. – Responsibility of the network layer – Done on a session basis in virtual circuits and on a packet basis in datagrams – Desirable characteristics: • Correctness • Simplicity • Robustness • Stability • Fairness • Optimality • Efficiency – Elements of routing techniques for PSNs
9 Chap. 9 Packet Switching Least-Cost Algorithms (Determining least-cost paths) • Dijkstra’s algorithm N = set of nodes in the network s = source node M = set of nodes so far incorporated by the algorithm d ij = link cost from node I to j; d ii = 0, and d ij = ∞ if nodes are not directly connected D n = cost of the least-cost path from node s to node n that is currently known to the algorithm Algorithm 1. Initialize: M = {s}, D n = d sn for n ≠ s 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 s.t D w = min (j ∉ M) D j Add w to M 3. Update least-cost paths: D n = min[D n , D w + d wn ] for all n ∉ M Repeat steps 2 & 3 until M = N
10 Chap. 9 Packet Switching Example of least-cost routing algorithms
11 Chap. 9 Packet Switching
12 Chap. 9 Packet Switching • Bellman-Ford algorithm s = source node d ij = link cost from node I to j; d ii = 0, and d ij = ∞ if nodes are not directly connected h = maximum number of links in a path at the current stage of the algorithm D n (h) = cost of the least-cost path from node s to node n under the constraint of no more than h links Algorithm 1. Initialize: D n (0) = ∞ for all n ≠ s D s (h) = 0 for all h 2. For each successive h ≥ 0 D n (h+1) = min (j) [D j (h) + d jn ]
13 Chap. 9 Packet Switching • Routing Strategies – Fixed Routing • Routes fixed for a given topology • Central routing directory created using some optimality criterion • Each node only needs to store the first-hop destination for each of the paths • Simple but does not react to network congestion or failure Central Routing Directory From node 1 2 3 4 5 6 1 - 1 5 1 4 5 2 2 - 2 2 4 5 To 3 4 3 - 5 3 5 node 4 4 4 5 - 4 5 5 4 4 5 5 - 5 6 4 4 5 5 6 - Node 1 Directory Node 2 Directory Node 1 Directory Dest Next node Dest Next node Dest Next node 2 2 1 1 1 5 3 4 3 3 2 2 4 4 4 4 4 5 5 4 5 4 5 5 6 4 6 4 6 5
14 Chap. 9 Packet Switching – Flooding • Source sends packet to all nodes connected to it • When a node receives packet, it forwards it to all nodes except the one that gave the packet • Most robust, but tremendous waste of network capacity • Guarantees minimum-hop delivery • Used usually for broadcast; need mechanism to control indefinite retransmissions: use packet id or hop counter decremented every hop (initialized to network diameter) • Also used when ultra-reliable delivery required. E.g. military applications
15 Chap. 9 Packet Switching – Random routing • When a node receives packet, it randomly sends it off on some other link • Can be improved by making probabilistic decision based on link data rates: Data rate on link i R i = P Data rate on all links i R � j j Prob. of picking link i • Like flooding, require no network information • Simple but not in common use – Adaptive routing • Routing strategy that continuously changes to adapt to changing environment • Can improve performance, but algorithms become much more complex; increases processing burden and traffic burden; may react too quickly, causing congestion- producing oscillation • Three types of adaptive strategies – Isolated adaptive: local info., distributed control – Distributed adaptive: info. From neighbors, distributed control – Centralized adaptive: info. From all nodes, centralized control
16 Chap. 9 Packet Switching – Example of a simple isolated adaptive routing Choose the outgoing link that minimizes Q + B i Bias Queue length
17 Chap. 9 Packet Switching 3. CONGESTION CONTROL • Maintain the number of packets within the network or a region of the network below the level at which queuing delays blow up • Packet switching network is a network of queues Input and output queues of a node Interaction of queues
Recommend
More recommend