27
Chap. 9 Packet Switching 1 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

1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Embed Size (px)

Citation preview

Page 1: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 1

1. Packet-Switching Principles

• Store & forward scheme– message is split into size-limited packets for

transmission

• Pipelining of packet transmission reducestransmission 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

Page 2: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 2

• Relationship between packet size and trans. time

Page 3: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 3

• Comparison of circuit switching and packet switching

Page 4: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 4

Dedicated transmission pathContinuous transmission of dataFast enough for interactiveMessages are not stored

The path is established for entire conversationCall setup delay; negligible transmission delayBusy signal if called party busyOverload may block call setup; no delay for established callsElectromechanical or computerized switching nodesUser responsible for message loss protectionUsually no speed or code conversionFixed bandwidth transmissionNo overhead bits after call setup

No dedicated pathTransmission of packets

Fast enough for interactivePackets may be stored until deliveredRoute established for each packetPacket transmission delay

Sender may be notified if packet not deliveredOverload increases packet delay

Small switching nodes

Network may be responsi- ble for individual packetsSpeed and code conversion

Dynamic use of bandwidth

Overhead bits in each packet

No dedicated pathTransmission of packets

Fast enough for interactivePackets stored until deliveredRoute established for entire conversationCall setup delay; packet transmission delaySender notified of connection denialOverload may block call setup; increases packet delaySmall switching nodes

Network may be responsi- ble for individual packets Speed and code conversion

Dynamic use of bandwidth

Overhead bits in each packet

Circuit switchingDatagram packet

switchingVirtual-circuitpacket switching

Page 5: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 5

(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.

• 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 theexternal structure.

– External view: interface between host and PSN– Internal view: operations inside PSN

Page 6: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 6

(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.

• 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)

Page 7: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 7

• 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. Forsome applications (e.g., credit checking, banking)higher level protocol will implement flow and errorcontrol 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

Page 8: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 8

2. ROUTING– In a packet switched network, need to determine a

path to get from a sender to a destination; usuallymultiple 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

Page 9: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 9

Least-Cost Algorithms (Determining least-cost paths)

• Dijkstra’s algorithm

N = set of nodes in the networks = source nodeM = set of nodes so far incorporated by the algorithmdij = link cost from node I to j; dii = 0, and dij = ∞ if nodes

are not directly connectedDn = cost of the least-cost path from node s to node n that

is currently known to the algorithm

Algorithm1. Initialize: M = {s}, Dn = dsn for n ≠ s2. 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 Dw = min(j ∉ M) Dj

Add w to M3. Update least-cost paths:

Dn = min[Dn , Dw + dwn] for all n ∉ MRepeat steps 2 & 3 until M = N

Page 10: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 10

Example of least-cost routing algorithms

Page 11: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 11

Page 12: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 12

• Bellman-Ford algorithm

s = source nodedij = link cost from node I to j; dii = 0, and dij = ∞ if nodes

are not directly connectedh = maximum number of links in a path at the current

stage of the algorithmDn

(h) = cost of the least-cost path from node s to node nunder the constraint of no more than h links

Algorithm1. Initialize:

Dn(0) = ∞ for all n ≠ s

Ds(h) = 0 for all h

2. For each successive h ≥ 0 Dn

(h+1) = min(j) [Dj(h) + djn]

Page 13: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 13

• 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

- 1 5 1 4 5

2 - 2 2 4 5

4 3 - 5 3 5

4 4 5 - 4 5

4 4 5 5 - 5

4 4 5 5 6 -

1 2 3 4 5 6

1

2

3

4

5

6

From node

Tonode

Central Routing Directory

Node 1 DirectoryDest Next node

23456

24444

Node 2 DirectoryDest Next node

13456

13444

Node 1 DirectoryDest Next node

12456

52555

Page 14: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 14

– 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 counterdecremented every hop (initialized to network diameter)

• Also used when ultra-reliable delivery required. E.g.military applications

Page 15: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 15

– 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:

• 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 trafficburden; 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

�j jR R

=Pi

i

Data rate on link i

Data rate on all links

Prob. of picking link i

Page 16: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 16

– Example of a simple isolated adaptive routing

Choose the outgoing link that minimizesQ + Bi

Queue length Bias

Page 17: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 17

3. CONGESTION CONTROL

• Maintain the number of packets within the network or aregion of the network below the level at which queuingdelays blow up

• Packet switching network is a network of queues

Input and output queuesof a node

Interaction of queues

Page 18: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 18

Effects of congestion

Packet processing rate < packet input ratePackets from many inputs into same output

Node queuesbuild up

Source has toretransmit packets

Some input packetsmust be discarded

Shortageof buffers

Page 19: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 19

• Congestion control mechanisms in packet-switchingnetworks

– Send a control packet (choke packet) from acongested node to some or all nodes.

– Rely on routing information.

– Make use of an end-to-end prove packet.

– Allow packet switching nodes to add congestioninformation to packets as they go by.

Page 20: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 20

4. X.25

• CCITT standard protocol for accessing the public packet-switching networks

• Provides an interface between the DTE and DCE– DTE: Data Terminal Equipment. Provides end to end

communication across the network– DCE: Data Circuit-terminating Equipment. Provides interface

between the DTE and the network.DTE ⇔ DCE ⇔ packet switching network ⇔ DCE ⇔ DTE

• The X.25 interface between the DTE and the DCEspecifies the first three levels of the OSI model.

• Physical layer specifies the use of full-duplex, point-to-point synchronous circuit. (Defined by X.21 or V.24 (EIA-232))

• Link layer standard is LAP-B (Balanced Link AccessProtocol), which is a subset of balanced mode HDLC.

X.25 Interface

Page 21: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 21

• The packet level (network layer) specifies the manner inwhich control information and user data are structured intopackets.

• Type of connections provided in X.25– 1. Virtual call (VC), also called switched virtual call (SVC)

• A call setup procedure is required for each session

– 2. Permanent virtual circuit (PVC)• No call setup and clearing procedures are required. A permanent

association exists, which is analogous to a point-to-point privateline.

– 3. Fast select call• Provides for the exchange of up to 128 bytes of data while the

call is set up and cleared. Used for small messages or simplecommands.

Page 22: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 22

• X.25 Packet Formats

• Data PacketsContains the following fields

– Virtual Circuit number (12 bits) - 4 bit logical group number +8 bit logical channel number. Typically the two fields aretreated as one. Used to indicate the type of calls or channelsbetween DTEs. Different call types allows multiple sessionsbetween the same two DTEs. There can be up to 4095logical channels on the same physical interface line.

– Q bit (Qualifier bit) - Distinguishes between a packetcontaining qualified data (i.e. user information Q=0) and onecontaining control information (Q=1).

Page 23: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 23

– M bit (More bit) - Set to indicate more packets follow insequence. Public switched networks have a maximum limiton the data packet size. Long messages are broken into anumber of packets. Each packet except the last one wouldhave the more bit on (M=1)

– D bit - Set to 0 when this packet is a part of a split packet(caused by fragmentation). Set to 1 when the packet isrecombined. Also used for flow control. When D=0, flowcontrol is locally performed (between the DTE and the localDCE). When D=1, flow control is performed between theDTE and the remote DTE.

– P(R) - Receive sequence number– P(S) - Send sequence number

• Control PacketsSix groups; call setup, flow control, supervisory, confirmation,diagnostic, and interrupt. The packet type identifierdistinguishes one control packet from another.

– Call setup packets• Four types; Call Request, Incoming Call, Call Accepted, and Call

Connected.• Used during the switched virtual circuit call setup phase.

– Flow control packets• Three types; Receive Ready (RR), Receive Not Ready (RNR),

and Reject (REJ).• Used only during the data transfer phase. Each of these packets

carries a packet receive sequence number P(R).• Same meaning as in HDLC

– Supervisory packets• Includes Restart Request/Indication, Clear Request/Indication,

Reset Request/Indication.• Restart Request is used in a disaster situation, such as a host

crash, to clear virtual circuits held by the DTE issuing this packet.• Clear Request disconnects the virtual circuit identified by the

packet’s virtual circuit number.

Page 24: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 24

• Reset request is used to reset a particular send and receivesequence numbers to zero in the data transfer mode.

– Confirmation packets• Used to acknowledge the execution of a previously requested

action (for Restart, Clear, Reset, and Interrupt).

– Diagnostic packets• Generated by the network for fault diagnosis

– Interrupt packet• Transmitted in the data transfer phase, and it does not contain

send/receive sequence number. That is, the interrupt packet isnot subject to flow control. (Flow control is bypassed, and theinterrupt packet is delivered to the destination DTE at a higherpriority than data packets in transit.)

X.25 packet types and parameters

Page 25: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 25

• Call setup procedureFor the DTEa ⇔ DCEa ⇔ PSN ⇔ DCEb ⇔ DTEbconfiguration, if DTEa wants to call DTEb across the network,it must go through the following steps.

– 1). DTEa picks a virtual circuit number (VCN)– 2). DTEa sends a call-request packet (containing virtual

circuit number, DTEa’s source address, DTEb’s destinationaddress) to DTEb.

– 3). DCEa routes this packetto DCEb across packet switching network.

– 4). DCEb picks a new VCN and sends incoming-call packet to DTEb. (The packet has new VCN and source/destination address info.)

– 5). DTEb accepts by sending call-accepted packet to DCEb,which routes it to DCEa.

– 6). DCEa receives call-accepted packet and sends call-connected packet to DTEa.

After this process, DTEa and DTEb can send data packetsone another.

• Call comple procedureSame scenario as above but suppose DTEa wants to endsession with DTEb.

– 1). DTEa send clear-request to DCEa– 2). DCEa sends clear-indication to DTEb (through DCEb)– 3). DTEb sends clear-indication to DTEb (through DCE’s)

Page 26: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 26

Page 27: 1. Packet-Switching Principles - Petra Christian Universityfaculty.petra.ac.id/resmana/private/komdat-slides/chap9.pdf · Chap. 9 Packet Switching 4 Dedicated transmission path Continuous

Chap. 9 Packet Switching 27

• Fragmentation/Segmentation

– Consider following scenario on the network with stations A, B,C, and D connected like A - B - C - D. Packet types aredefined asA - B : 1500 bytes size packetsB - C : 1000 bytes size packetsC - D : 1500 bytes size packets

– Say A wants to send a full packet of data to D. Then it sendsa 1500 byte packets to B. The B - C connection cannothandle packets this long

– B must break up the packet into pieces. This is calledsegmentation or fragmentation.

– To correct this, C must be able to recognize a split packetand to reassemble it for transmission to D.

– X.25 allows fragmentation through its M and D bits. Thesebits allow stations to recognize split and reassembledpackets and to reassemble and acknowledge themaccordingly (i.e., don’t ACK each piece of a split packet. OnlyACK when the packet is reassembled into one piece.)