Computer Networks Packet Switchings.pptx

AvinashAvuthu2 34 views 40 slides Jan 05, 2025
Slide 1
Slide 1 of 40
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40

About This Presentation

Computer Networks Packet Switching


Slide Content

Switching Dr. A. Avinash Assistant Professor Department of Computer Science & Engineering Vignan’s Foundation for Science Technology & Research

S witching The process of moving the data packets towards their destination by forwarding them from one port to the other port is called as  switching. Source: https://www.gatevidyalay.com/packet-switching-switching-in-computer-networks/

Circuit Switching Circuit Switching operates in following three phases Establishing a circuit Transferring the data Disconnecting the circuit Telephone system network is one of the example of Circuit switching.  TDM (Time Division Multiplexing) and FDM (Frequency Division Multiplexing)  are two methods of multiplexing multiple signals into a single carrier. 

Advantages and Disadvantages Advantages:     The main advantage of circuit switching is that a committed transmission channel is established between the computers which give a guaranteed data rate. There is no header overhead. There is no waiting time at any switch and the data is transmitted without any delay. Data always reaches the other end in order, No re ordering is required. Disadvantages:       It takes a long time to establish a connection. More bandwidth is required in setting up dedicated channels. It cannot be used to transmit any other data even if the channel is free as the connection is dedicated to circuit switching .

Calculation: Packet travel time T ime taken to transmit a message in circuit switched network = Connection set up time + Transmission delay + Propagation delay + Tear down time where- Transmission delay = Message size / Bandwidth Propagation delay = (Number of hops on way x Distance between 2 hops) / Propagation speed

Problem Consider all links in the network use TDM with 24 slots and have a data rate of 1.536 Mbps. Assume that host A takes 500 msec to establish an end to end circuit with host B before begin to transmit the file. If the file is 512 kilobytes, then how much time will it take to send the file from host A to host B ?   Solution: Calculating Bandwidth Per User Total bandwidth = Number of users x Bandwidth per user Bandwidth per user = Total bandwidth / Number of users = 1.536 Mbps / 24 = 0.064 Mbps = 64 Kbps

Solution Cont.. Calculating Transmission Delay Transmission delay (T t ) = File size / Bandwidth = 512 KB / 64 Kbps = (512 x 2 10  x 8 bits) / (64 x 10 3  bits per sec) = 65.536 sec = 65536 msec Calculating Time Required To Send File   Time taken to send a file in circuit switched network = Connection set up time + Transmission delay = 500 msec + 65536 msec = 66036 msec = 66.036 sec

Message Switching No dedicated path to transfer data. The entire message is treated as a single data unit. Store and Forward  is an important characteristic of message switching. The message carries a header that contains the full information about the destination. A ny intermediate switch receives the message, it stores the entire message. The message is stored until sufficient resources become available to transfer it to the next switch. When resources become available, the switch forwards the message to the next switch

Advantages and Disadvantages Advantages: It improves the channel efficiency over  Circuit Switched Network . In circuit switched network, the channel is blocked for two ends only, But here, more devices can share the channel . The message may be temporarily stored in the route and then forwarded whenever required It is helpful in setting the message priorities due to store and forward technique. Disadvantages:   It requires enough storage at every switch to accommodate the entire message during the transmission . It is extremely slow due to store and forward technique. Also, the message has to wait until sufficient resources become available to transfer it to the next switch.

Packet Switching The entire message to be sent is divided into multiple smaller size packets. This process of dividing a single message into smaller size packets is called as  packetization . These smaller packets are sent after the other. It gives the advantage of pipelining and reduces the total time taken to transmit the message.

Packet-switching: store-and-forward packet transmission delay: takes L / R seconds to transmit (push out) L -bit packet into link at R bps store and forward: entire packet must arrive at router before it can be transmitted on next link source R bps destination 1 2 3 L bits per packet R bps One-hop numerical example: L = 10 Kbits R = 100 Mbps one-hop transmission delay = 0.1 msec

Packet delay: four sources d proc : nodal processing check bit errors determine output link typically < microsecs d queue : queueing delay time waiting at output link for transmission depends on congestion level of router propagation nodal processing queueing d nodal = d proc + d queue + d trans + d prop A B transmission

Packet delay: four sources propagation nodal processing queueing d nodal = d proc + d queue + d trans + d prop A B transmission d trans : transmission delay: L : packet length (bits) R : link transmission rate (bps) d trans = L/R d prop : propagation delay: d : length of physical link s : propagation speed (~3x10 8 m/sec) d prop = d / s d trans and d prop very different

Packet-switching: queueing A B C R = 100 Mb/s R = 1.5 Mb/s D E queue of packets waiting for transmission over output link Packet queuing and loss: i f arrival rate (in bps) to link exceeds transmission rate (bps) of link for some period of time: packets will queue, waiting to be transmitted on output link packets can be dropped (lost) if memory (buffer) in router fills up

How do packet delay and loss occur? packets queue in router buffers, waiting for turn for transmission queue length grows when arrival rate to link (temporarily) exceeds output link capacity packet loss occurs when memory to hold queued packets fills up A B packet being transmitted (transmission delay) packets in buffers (queueing delay) free (available) buffers: arriving packets dropped ( loss ) if no free buffers

How do packet delay and loss occur? queue (aka buffer) preceding link in buffer has finite capacity A B packet being transmitted buffer (waiting area) packet arriving to full buffer is lost packet arriving to full queue dropped (aka lost) lost packet may be retransmitted by previous node, by source end system, or not at all

Throughput throughput: rate (bits/time unit) at which bits are being sent from sender to receiver instantaneous: rate at given point in time average: rate over longer period of time server, with file of F bits to send to client link capacity R s bits/sec link capacity R c bits/sec server sends bits (fluid) into pipe pipe that can carry fluid at rate ( R s bits/sec) pipe that can carry fluid at rate (R c bits/sec)

Advantages and Disadvantages Advantage:     Efficient in terms of bandwidth, since the concept of reserving circuit is not there. Node can detect the missing packet. Fault tolerant because packets may follow a different path in case any link is down, Unlike Circuit Switching . D isadvantage:     Packet Switching doesn’t follow packets in order, whereas Circuit Switching provides ordered delivery of packets because all the packets follow the same path. Complexity is more at each node because of the facility to follow multiple paths. Transmission delay is more because of rerouting. Packet Switching is beneficial only for small messages, but for bursty data (large messages) Circuit Switching is better.

Types of Packet Switching

Difference between switching

Comparisons of switching

Virtual Circuit and datagram Switching

Problem There is a network having bandwidth of 1 MBps . A message of size 1000 bytes has to be sent. Packet switching technique is used. Each packet contains a header of 100 bytes Out of the following, in how many packets the message must be divided so that total time taken is minimum- 1 packet 5 packets 10 packets 20 packets

Solution Size Of Packet = 1000 bytes of data + 100 bytes of header = 1100 bytes Transmission Delay = Packet size / Bandwidth = 1100 bytes / 1 MBps = 11 x 10 -4  sec = 1.1 msec Total Time Taken = 3 x Transmission delay = 3 x 1.1 msec = 3.3 msec

5 packets Data Sent in One Packet = Total data to be sent / Number of packets = 1000 bytes / 5 = 200 bytes Size Of One Packet = 200 bytes of data + 100 bytes of header = 300 bytes Transmission Delay = Packet size / Bandwidth = 300 bytes / 1 MBps = 300 x 10 -4   sec = 0.3 msec Time Taken By First Packet = 3 x Transmission delay = 3 x 0.3 msec = 0.9 msec   Time Taken By Remaining Packets = Number of remaining packets x Transmission delay = 4 x 0.3 msec = 1.2 msec Total Time Taken = 0.9 msec + 1.2 msec = 2.1 msec

Solution Cont.. When data is sent in 1 packet, total time taken = 3.3 msec When data is sent in 5 packets, total time taken = 2.1 msec When data is sent in 10 packets, total time taken = 2.4 msec When data is sent in 20 packets, total time taken = 3.3 msec Total time decreases when packet size is reduced but only up to a certain limit. If the packet size is reduced beyond a certain limit, then total time starts increasing.   From the given choices, Sending the message in 5 packets would be most efficient. In other words, packet size = 300 bytes would be the best choice.

Problem In a packet switching network, packets are routed from source to destination along a single path having two intermediate nodes. If the message size is 24 bytes and each packet contains a header of 3 bytes, then the optimum packet size is 4 bytes 6 bytes 7 bytes 9 bytes

Solution Let bandwidth of the network = X Bps and 1 / X = a Packet Size = 4 Bytes Data Sent in One Packet = Packet size – Header size = 4 bytes – 3 bytes = 1 byte Number Of Packets required = Total data to be sent / Data contained in one packet = 24 bytes / 1 byte = 24 packets Transmission Delay- = Packet size / Bandwidth = 4 bytes / X Bps = 4a sec   Time Taken By First Packet = 3 x Transmission delay = 3 x 4a sec = 12a sec Time Taken By Remaining Packets = Number of remaining packets x Transmission delay = 23 x 4a sec = 92a sec Total Time Taken = 12a sec + 92a sec = 104a sec

Solution Cont.. Total time taken when packet size is 4 bytes = 104a sec Total time taken when packet size is 6 bytes = 60a sec Total time taken when packet size is 7 bytes = 56a sec Total time taken when packet size is 9 bytes = 54a sec Result: Time taken is minimum when packet size is 9 bytes.

Switching Techniques In large networks there might be multiple paths linking sender and receiver. Information may be switched as it travels through various communication channels. There are three typical switching techniques available for digital traffic. Circuit Switching Message Switching Packet Switching

Circuit Switching Circuit switching is a technique that directly connects the sender and the receiver in an unbroken path. Telephone switching equipment, for example, establishes a path that connects the caller's telephone to the receiver's telephone by making a physical connection. With this type of switching technique, once a connection is established, a dedicated path exists between both ends until the connection is terminated. Routing decisions must be made when the circuit is first established, but there are no decisions made after that time.

Circuit Switching Circuit switching in a network operates almost the same way as the telephone system works. A complete end-to-end path must exist before communication can take place. The computer initiating the data transfer must ask for a connection to the destination. Once the connection has been initiated and completed to the destination device, the destination device must acknowledge that it is ready and willing to carry on a transfer.

Circuit switching Advantages: The communication channel (once established) is dedicated. Disadvantages: Possible long wait to establish a connection, (10 seconds, more on long- distance or international calls.) during which no data can be transmitted. More expensive than any other switching techniques, because a dedicated path is required for each connection. Inefficient use of the communication channel, because the channel is not used when the connected systems are not using it.

Message Switching With message switching there is no need to establish a dedicated path between two stations. When a station sends a message, the destination address is appended to the message. The message is then transmitted through the network, in its entirety, from node to node. Each node receives the entire message, stores it in its entirety on disk, and then transmits the message to the next node. This type of network is called a store-and-forward network.

Message Switching A message-switching node is typically a general-purpose computer. The device needs sufficient secondary-storage capacity to store the incoming messages, which could be long. A time delay is introduced using this type of scheme due to store- and-forward time, plus the time required to find the next node in the transmission path.

Message Switching Advantages: Channel efficiency can be greater compared to circuit- switched systems, because more devices are sharing the channel. Traffic congestion can be reduced, because messages may be temporarily stored in route. Message priorities can be established due to store-and-forward technique. Message broadcasting can be achieved with the use of broadcast address appended in the message.

Message Switching Disadvantages Message switching is not compatible with interactive applications. Store-and-forward devices are expensive, because they must have large disks to hold potentially long messages.

Packet Switching Packet switching can be seen as a solution that tries to combine the advantages of message and circuit switching and to minimize the disadvantages of both. There are two methods of packet switching: Datagram and virtual circuit.

Packet Switching In both packet switching methods, a message is broken into small parts, called packets. Each packet is tagged with appropriate source and destination addresses. Since packets have a strictly defined maximum length, they can be stored in main memory instead of disk, therefore access delay and cost are minimized. Also the transmission speeds, between nodes, are optimized. With current technology, packets are generally accepted onto the network on a first-come, first-served basis. If the network becomes overloaded, packets are delayed or discarded (``dropped'').

Packet size The size of the packet can vary from 180 bits, the size for the Datakit® virtual circuit switch designed by Bell Labs for communications and business applications; to 1,024 or 2,048 bits for the 1PSS® switch, also designed by Bell Labs for public data networking; to 53 bytes for ATM switching, such as Lucent Technologies' packet switches.
Tags