11.) Delays with multiple links. Consider a packet of length L which begins at e
ID: 3760834 • Letter: 1
Question
11.) Delays with multiple links. Consider a packet of length L which begins at end system A, travels over one link to a packet switch, and travels from the packet switch over a second link to a destination end system. Let d1,s1 and r1 denote the length, propagation speed, and transmission rate of link i, i = 1, 2. for The packet switch delays each packet by dproc. Assuming no queuing delays, in terms of d1,s1, r1 (i=1,2) and L, what is the total end-to-end delay for the packet? Suppose the packet is 1,000 bytes, the propagation speed on both links is 2.5 x 10^8 m/s, the transmission rates of both links is 1 Mbps, the packet switch processing delay is 1 msec, the length of the first link is 4,000 km, and the length of the last link is 1,000 km. For these values, what is the end-to-end delay?
Review problem 11 in the practice problem handout. Complete the following:
a. Write a program (Java, C++, C or any other language) to solve this problem. Your program will get the inputs (d, S, R and others), solve for delay and displays it on the screen.
b. Repeat the program for 5 links. Assume that the data is in a spreadsheet file. Your program will read the file for data and use the data to complete the delay calculation, and display the result on screen.
Explanation / Answer
The end-to-end delay is given by the formula:
End to End Delay = [Nx(L/R)] x P
Where:
L : Length of packet
N : No. of links
R : Transmission rate
P : No. of packets sent back-to-back over the N links.
So for the given problem:
L = 1000 bytes
N = 2
R = 1MBPS = 106 bytes/sec
P = 1
Therefore, End to end delay = [2x(1000/106)]x1 = 2x10-3sec = 2ms
Total length packet has to travel = 5000 km = 5x106 m
Propagation Speed = 2.5x108m/sec
Total time taken for pkt. to travel from end to end without delay = (5x106 m) / (2.5x108m/sec) = 2x10-2sec = 20ms
Thus, Total time taken for packet to travel from A to B = 20ms + 2ms = 22ms.
________________________________________________________________________________________________
C++ program for this is as shown below:
#include <iostream>
using namespace std;
int main() {
// your code goes here
int N, L, R, P, Delay, Total, Time, S, X1, X2;
cout<<"Enter the Length of packet(N) in bytes, No. of links(L), Transmission rate(R) in bytes/sec, and No. of packets sent back-to-back over the N links(P) in respective order";
cin>>N>>L>>R>>P;
Delay = [ N * ( L / R ) ] * P;
cout<<" The End to End delay is : "<<Delay;
cout<<" Enter propagation speed in metres/sec: ";
cin>>S;
cout<<" Enter length of 2 links A and B in meters:";
cin>>X1>>X2;
Time = (X1 + X2)/S;
cout<<" Total travel time of packet without delay : "<<Time;
Total = Time + Delay;
cout<<" Overall travel time of packet from A to B is : "<<Total;
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.