Data and Computer Communications Chapter 10 Packet Switching.

42
Data and Computer Communications Chapter 10 Packet Switching

Transcript of Data and Computer Communications Chapter 10 Packet Switching.

Page 1: Data and Computer Communications Chapter 10 Packet Switching.

Data and Computer Communications

Chapter 10Packet Switching

Page 2: Data and Computer Communications Chapter 10 Packet Switching.

Basic OperationData 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

Page 3: Data and Computer Communications Chapter 10 Packet Switching.

Use of Packets

Page 4: Data and Computer Communications Chapter 10 Packet Switching.

AdvantagesLine 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

Page 5: Data and Computer Communications Chapter 10 Packet Switching.

Switching TechniqueStation breaks long message into packetsPackets sent one at a time to the networkPackets handled in two ways

Datagram Virtual circuit

Page 6: Data and Computer Communications Chapter 10 Packet Switching.

DatagramEach packet treated independentlyPackets can take any practical routePackets may arrive out of orderPackets may go missingUp to receiver to re-order packets and

recover missing packets

Page 7: Data and Computer Communications Chapter 10 Packet Switching.

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)

Page 8: Data and Computer Communications Chapter 10 Packet Switching.

Virtual Circuits versus DatagramVirtual circuits

Network can provide sequencing and error control Packets are forwarded more quickly

No routing decisions to make

Less reliableLoss of a node looses all circuits through that node

Datagram No call setup phase

Better if few packets

More flexibleRouting can be used to avoid congested parts of the

network

Page 9: Data and Computer Communications Chapter 10 Packet Switching.

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.

Page 10: Data and Computer Communications Chapter 10 Packet Switching.

Circuit v Packet SwitchingPerformance; 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)

Page 11: Data and Computer Communications Chapter 10 Packet Switching.

Event Timing

Page 12: Data and Computer Communications Chapter 10 Packet Switching.

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

Page 13: Data and Computer Communications Chapter 10 Packet Switching.

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

Page 14: Data and Computer Communications Chapter 10 Packet Switching.

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

Page 15: Data and Computer Communications Chapter 10 Packet Switching.

External Virtual Circuit andDatagram Operation

Page 16: Data and Computer Communications Chapter 10 Packet Switching.

InternalVirtualCircuit andDatagram Operation

Page 17: Data and Computer Communications Chapter 10 Packet Switching.

RoutingComplex, crucial aspect of packet

switched networksCharacteristics required

Correctness Simplicity Robustness Stability Fairness Optimality Efficiency

Page 18: Data and Computer Communications Chapter 10 Packet Switching.

Performance CriteriaUsed for selection of route and based on:Minimum hop or:Least cost

See Stallings appendix 10A for routing algorithms

Page 19: Data and Computer Communications Chapter 10 Packet Switching.

Decision Time and Place2 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

CentralizedDecision made by a central network node

SourceDecision made by source

Page 20: Data and Computer Communications Chapter 10 Packet Switching.

Network Information Source and Update TimingRouting decisions are usually (not not always)

based on knowledge of networkDistributed 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

Page 21: Data and Computer Communications Chapter 10 Packet Switching.

Routing StrategiesFixedFloodingRandomAdaptive

Page 22: Data and Computer Communications Chapter 10 Packet Switching.

Fixed RoutingSingle permanent route for each source to

destination pairDetermine routes using a least cost

algorithm (appendix 10A)Route fixed, at least until a change in

network topology happens

Page 23: Data and Computer Communications Chapter 10 Packet Switching.

Fixed RoutingTables

For each source-destination pair, the routing table shows the next node on the route.

Page 24: Data and Computer Communications Chapter 10 Packet Switching.

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

Page 25: Data and Computer Communications Chapter 10 Packet Switching.

Flooding Example

Page 26: Data and Computer Communications Chapter 10 Packet Switching.

Properties of FloodingAll 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)

Page 27: Data and Computer Communications Chapter 10 Packet Switching.

Random RoutingNode selects one outgoing path for

retransmission of incoming packetSelection can be random or round robinCan select outgoing path based on

probability calculationNo network info neededRoute is typically neither least cost nor

minimum hop

Page 28: Data and Computer Communications Chapter 10 Packet Switching.

Adaptive RoutingUsed by almost all packet switching networksRouting decisions change as conditions on

the network change Failure Congestion

Requires info about networkDecisions are more complexThe tradeoff here is between quality of

network info and overhead associated with the time involved in gathering the information, etc.

Page 29: Data and Computer Communications Chapter 10 Packet Switching.

Adaptive Routing - AdvantagesImproved performanceAids in congestion control (covered in

chapter 12)

Page 30: Data and Computer Communications Chapter 10 Packet Switching.

X.25Originally approved in 1976Specifies interface between host and

packet switched networkAlmost universal on packet switched

networks and packet switching in ISDNDefines three layers

Physical Link Packet

Page 31: Data and Computer Communications Chapter 10 Packet Switching.

X.25 - Physical LayerSpecifies interface between attached station

and link to nodeData 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

Page 32: Data and Computer Communications Chapter 10 Packet Switching.

X.25 - Link LayerUses 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)

Page 33: Data and Computer Communications Chapter 10 Packet Switching.

X.25 - PacketProvides external virtual circuit service

which enables logical connections (virtual circuits) between subscribers

Page 34: Data and Computer Communications Chapter 10 Packet Switching.

X.25 Use of Virtual Circuits

Page 35: Data and Computer Communications Chapter 10 Packet Switching.

Virtual Circuit ServiceProvides 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.

Page 36: Data and Computer Communications Chapter 10 Packet Switching.

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

Page 37: Data and Computer Communications Chapter 10 Packet Switching.

Packet Format (see Page 333)

Page 38: Data and Computer Communications Chapter 10 Packet Switching.

MultiplexingMost important service provided by X.25Packets contain a 12 bit virtual circuit

numberDTE 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

Page 39: Data and Computer Communications Chapter 10 Packet Switching.

Virtual Circuit Numbering

Used when address overflow from top or bottom happens

Page 40: Data and Computer Communications Chapter 10 Packet Switching.

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

Page 41: Data and Computer Communications Chapter 10 Packet Switching.

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

Page 42: Data and Computer Communications Chapter 10 Packet Switching.

Reset and RestartTwo 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