department of electronic engineering city university of hong kong ee3900 data communications and...
Post on 21-Dec-2015
220 views
TRANSCRIPT
EE3900 Data Communications and LANs Packet Switching Slide 1
Department of Electronic Engineering City University of Hong Kong
Packet Switching
EE3900 Data Communications and LANs Packet Switching Slide 2
Department of Electronic Engineering City University of Hong Kong
Outline
• Packet-switching Principles
• Switching Techniques
• Comparison of Circuit Switching and Packet Switching
• Simple Routing Schemes
• Congestion Control
EE3900 Data Communications and LANs Packet Switching Slide 3
Department of Electronic Engineering City University of Hong Kong
Circuit Switching
• Circuit switching designed for voice or constant rate services– Resources are dedicated to a particular call for
the call duration– In data traffic, some of the time, no data are
sent– Data rate is pre-arranged
• Both ends must operate at the same rate
EE3900 Data Communications and LANs Packet Switching Slide 4
Department of Electronic Engineering City University of Hong Kong
Packet Switching• Data transmitted in small packets
– Typically 1k to 2k octets
– Longer messages are split into series of packets
– Each packet contains a data field plus some control info
• Control information
– Routing (addressing) info
• Packets are received, stored briefly (buffered) and passed on to the next node
– Store and forward
EE3900 Data Communications and LANs Packet Switching Slide 5
Department of Electronic Engineering City University of Hong Kong
Advantages• Line efficiency
– Single node to node link can be shared by many packets on a on-demand basis, improve efficiency and reliability
– Packets are queued and transmitted as fast as possible
• Data rate conversion– Each station connects to the local node at its own speed
– Nodes buffer data and send to the station
– When the network is busy, packet accepting and delivery rates may be reduced
• Priority services can be implemented
EE3900 Data Communications and LANs Packet Switching Slide 6
Department of Electronic Engineering City University of Hong Kong
Packets
EE3900 Data Communications and LANs Packet Switching Slide 7
Department of Electronic Engineering City University of Hong Kong
Use of Packets
EE3900 Data Communications and LANs Packet Switching Slide 8
Department of Electronic Engineering City University of Hong Kong
Example of Packet Routing
A Packet Switching Network
EE3900 Data Communications and LANs Packet Switching Slide 9
Department of Electronic Engineering City University of Hong Kong
Packet Size
EE3900 Data Communications and LANs Packet Switching Slide 10
Department of Electronic Engineering City University of Hong Kong
Outline
• Packet-switching Principles
• Switching Techniques
• Comparison of Circuit Switching and Packet Switching
• Simple Routing Schemes
• Congestion Control
EE3900 Data Communications and LANs Packet Switching Slide 11
Department of Electronic Engineering City University of Hong Kong
Switching Technique• Station breaks long message into packets
• Packets are sent one at a time to the network
• Packets are handled in two ways:– Datagram– Virtual circuit
EE3900 Data Communications and LANs Packet Switching Slide 12
Department of Electronic Engineering City University of Hong Kong
Datagram Mode• Each packet is treated independently
• Packets can take any route
• Packets may arrive out of order
• Packets may go missing
• Up to the receiver to re-order the packets and to recover from missing packets
• IP uses datagram
EE3900 Data Communications and LANs Packet Switching Slide 13
Department of Electronic Engineering City University of Hong Kong
Datagram Mode
EE3900 Data Communications and LANs Packet Switching Slide 14
Department of Electronic Engineering City University of Hong Kong
Virtual Circuit Mode• Preplanned route decided at connection establishment
• Call request and call accept packets establish the connection (handshake)
• Each packet contains a virtual circuit identifier instead of destination address
• No routing decisions required for each packet
• Clear request to terminate circuit
• Not a dedicated path, links are shared by different packets
EE3900 Data Communications and LANs Packet Switching Slide 15
Department of Electronic Engineering City University of Hong Kong
Virtual Circuit Mode
EE3900 Data Communications and LANs Packet Switching Slide 16
Department of Electronic Engineering City University of Hong Kong
X.25 Use of Virtual Circuits
EE3900 Data Communications and LANs Packet Switching Slide 17
Department of Electronic Engineering City University of Hong Kong
Public Switched Data Networks
• An example of packet switching network
• A network for data communications over a wide area
• Also operated by telephone companies
• Based on X.25 standard from ITU-T, specifying an interface between a host system and a packet switching network
• low speed, up to 64kb/s
EE3900 Data Communications and LANs Packet Switching Slide 18
Department of Electronic Engineering City University of Hong Kong
Virtual Circuits vs Datagram• Virtual circuits
– Network provides sequencing and error control– Packets are forwarded more quickly
• No routing decisions to make
– Less reliable• Loss of a node will lose all circuits through that node
• Datagram– No call setup phase
• Better for low number of data packets
– More flexible• Routing can be used to avoid congested parts of the network
EE3900 Data Communications and LANs Packet Switching Slide 19
Department of Electronic Engineering City University of Hong Kong
Outline
• Packet-switching Principles
• Switching Techniques
• Comparison of Circuit Switching and Packet Switching
• Simple Routing Schemes
• Congestion Control
EE3900 Data Communications and LANs Packet Switching Slide 20
Department of Electronic Engineering City University of Hong Kong
Delays• Propagation delay: time for a signal to
propagate from one node to the next
• Transmission time: time for a transmitter to send out a block of data, transmission capacity dependent
• Node delay: the time for a node to process and to switch the data
EE3900 Data Communications and LANs Packet Switching Slide 21
Department of Electronic Engineering City University of Hong Kong
Circuit Switching vs Packet Switching
Event Timing for Circuit Switching and Packet Switching
EE3900 Data Communications and LANs Packet Switching Slide 22
Department of Electronic Engineering City University of Hong Kong
Circuit Switching vs Packet Switching (Cont’d)
• Circuit switching: connection set-up is required before data transfer
• Virtual circuit packet switching:connection set-up is needed before data transfer
• Datagram packet switching: no set-up is required
EE3900 Data Communications and LANs Packet Switching Slide 23
Department of Electronic Engineering City University of Hong Kong
EE3900 Data Communications and LANs Packet Switching Slide 24
Department of Electronic Engineering City University of Hong Kong
Outline
• Packet-switching Principles
• Switching Techniques
• Comparison of Circuit Switching and Packet Switching
• Simple Routing Schemes
• Congestion Control
EE3900 Data Communications and LANs Packet Switching Slide 25
Department of Electronic Engineering City University of Hong Kong
Introduction– The need for routing: e.g. Getting from A to F
A
BD
C E
F
Path 1: A->B->D->FPath 2: A->B->E->FPath 3: A->B->C->E->FPath 4: A->C->E->FPath 5: A->C->E->B->D->FPath 6: A->C->B->D->FPath 7: A->C->B->E->F
Which one?
EE3900 Data Communications and LANs Packet Switching Slide 26
Department of Electronic Engineering City University of Hong Kong
Routing• Complex, crucial aspect of packet switched
networks
• Performance used for selection of route: Minimum hop, Least cost
• Characteristics required:– Correctness, Simplicity, Robustness, Stability– Fairness, Optimality, Efficiency
Routing
EE3900 Data Communications and LANs Packet Switching Slide 27
Department of Electronic Engineering City University of Hong Kong
Routing Attributes
• Routing information gathering– Information source: local, adjacent nodes, all nodes
– Update time: never (fixed routing), regular update (adaptive routing)
• Routing path selection/calculation– Time: per packet, connection set-up
– Place: distributed nodes (distributed routing), centralized node (central routing), source node (source routing)
EE3900 Data Communications and LANs Packet Switching Slide 28
Department of Electronic Engineering City University of Hong Kong
Fixed Routing• Single permanent route for each source-
destination pair of nodes
• Determine routes using a least cost algorithm
• the link cost is based on expected traffic or capacity, but not on any dynamic variable such as instant traffic volume
• each node needs only to store the next forwarding address for each destination
EE3900 Data Communications and LANs Packet Switching Slide 29
Department of Electronic Engineering City University of Hong Kong
Cost of Routes in a Packet-Switched Network
EE3900 Data Communications and LANs Packet Switching Slide 30
Department of Electronic Engineering City University of Hong Kong
Fixed RoutingTables
EE3900 Data Communications and LANs Packet Switching Slide 31
Department of Electronic Engineering City University of Hong Kong
Least-Cost Path • What is meant by least cost?
– It can be number of hops, physical distances, costs, delay, link capacity, current loading …
– Or an arbitrary function of the above parameters,
EE3900 Data Communications and LANs Packet Switching Slide 32
Department of Electronic Engineering City University of Hong Kong
Flooding• A packet is sent by the source node to every one of its neighbors• At each intermediate node, an incoming packet is retransmitted on
all outgoing links except for the incoming link • Eventually a number of copies will arrive at destination• Each packet is uniquely numbered so duplicates can be discarded• Advantage: no network information is required• Disadvantage: unlimited amount of traffic will be generated
unless something is done
EE3900 Data Communications and LANs Packet Switching Slide 33
Department of Electronic Engineering City University of Hong Kong
Flooding Example
EE3900 Data Communications and LANs Packet Switching Slide 34
Department of Electronic Engineering City University of Hong Kong
Solution for Flooding• Method 1: each node remembers the
identity of those packets it has already transmitted. When duplicate copies of the packet return, they are discarded.
• Method 2: Each packet contains a hop count field. Each time a node passes on a packet, it decrements the count by one. When the count reaches zero, the packet is discarded.
EE3900 Data Communications and LANs Packet Switching Slide 35
Department of Electronic Engineering City University of Hong Kong
Properties of Flooding• All possible routes between source and destination are
tried. Therefore, a packet will always get through if there is a connection between source and destination
• Because all routes are tried, at least one copy of the packet will arrive at the destination using a minimum-hop route; can be used to set up VC
• All nodes that are directly or indirectly connected to the source node are visited; useful to distribute information (routing)
EE3900 Data Communications and LANs Packet Switching Slide 36
Department of Electronic Engineering City University of Hong Kong
Random Routing• A node selects only one outgoing path for
transmission of an incoming packet
• The outgoing link is chosen at random, round robin or probability based; excluding the link on which the packet arrived
• Like flooding, no network information is required
• Random routing carries less traffic than flooding, but higher than optimum load
• Route is typically not least cost nor minimum hop
EE3900 Data Communications and LANs Packet Switching Slide 37
Department of Electronic Engineering City University of Hong Kong
Adaptive Routing
• The routing decisions change as conditions on the network change, such as node failure or link congestion
• Information about the state of the network are required and exchanged among the nodes
• The higher the amount and the more frequent information is exchanged (higher network overhead), the better decisions can be made
• React too quickly can cause oscillation, too slowly will not be adaptive
EE3900 Data Communications and LANs Packet Switching Slide 38
Department of Electronic Engineering City University of Hong Kong
Advantages of Adaptive Routing
• improve performance, as seen by the network user
• By-pass link congestions and node failures
EE3900 Data Communications and LANs Packet Switching Slide 39
Department of Electronic Engineering City University of Hong Kong
Drawbacks of Adaptive Routing
• The routing decision is more complex; hence, increase node processing
• Adaptive strategies depend on status information, collected at one location but used in another; therefore, the traffic loading on the network increases
EE3900 Data Communications and LANs Packet Switching Slide 40
Department of Electronic Engineering City University of Hong Kong
Isolated Adaptive Routing
EE3900 Data Communications and LANs Packet Switching Slide 41
Department of Electronic Engineering City University of Hong Kong
Outline
• Packet-switching Principles
• Switching Techniques
• Comparison of Circuit Switching and Packet Switching
• Simple Routing Schemes
• Congestion Control
EE3900 Data Communications and LANs Packet Switching Slide 42
Department of Electronic Engineering City University of Hong Kong
Congestion
• As packets arrive, they are stored in the input buffer of the corresponding link
• The node sends each incoming packet to the appropriate output buffer
• If packets arrive too fast for the node to process, or faster than the outgoing speed; packets will arrive for which no memory is available and packets will be lost.
EE3900 Data Communications and LANs Packet Switching Slide 43
Department of Electronic Engineering City University of Hong Kong
Causes of Congestion • Insufficient router memory, slow processors
(at routers), low-bandwidth links, etc.– Normal Traffic
– Congestion
Router
inco
min
g lin
ks
outg
oin
g lin
ks
Router
inco
min
g lin
ks
outg
oin
g lin
ksPackets are dropped due to lack of buffers.
Can we solve congestion by using huge amount of buffers?
EE3900 Data Communications and LANs Packet Switching Slide 44
Department of Electronic Engineering City University of Hong Kong
Effects of Congestion
• Throughput: As the offered load increases, throughput first increases, then drop and finally approaches to zero (Why? Any solution?)
• Delay: the average delay grows without bound as the load approaches the capacity of the system.
EE3900 Data Communications and LANs Packet Switching Slide 45
Department of Electronic Engineering City University of Hong Kong
Congestion• Introduction
– The effect of network congestion:
During congestion, the more you send, the less the network can deliver.
EE3900 Data Communications and LANs Packet Switching Slide 46
Department of Electronic Engineering City University of Hong Kong
The effect of congestion.
EE3900 Data Communications and LANs Packet Switching Slide 47
Department of Electronic Engineering City University of Hong Kong
General Strategies for Congestion Control
• discard any incoming packets for which there is no available buffer space
• exercise flow control over its neighbors (ask them to reduce sending rate), so that the traffic flow remains manageable. In fact, the traffic on the entire network needs to be managed.
EE3900 Data Communications and LANs Packet Switching Slide 48
Department of Electronic Engineering City University of Hong Kong
Congestion Control Algorithms• General Principles
• Open-loop congestion control algorithms
– Prevent congestion from occurring in the first place.
• Close-loop congestion control algorithms
– Monitor state of the network
– Feedback state information to the senders
– Adjust system operation to correct the problem
• Specific algorithms will be discussed in TCP