Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please helps me with this project. 1. You are simulating a simple network environment, in which Computer1 (A) sends data to Computer2 (B) (Assume that

Please helps me with this project.

1. You are simulating a simple network environment, in which Computer1 (A) sends data to Computer2 (B) (Assume that A only sends and B only receives data.) The data link layers of the hosts are to be simulated. Whenever a packet from the network layer arrives at the data link layer, the sender encapsulates the packet (datagram) into a link layer frame and sends it to the receiver. If the receiver receives the frame without errors during transmission, it sends an ACK frame to the sender. Note that frames can be lost or corrupted during transmissions. In this case, retransmission of frames should be handled by Stop-and-Wait ARQ. Assume that (a) It randomly takes [1,10] msec for a frame to travel from A to B (i.e., propagation time). So the average round trip time(RTT)betweentwohostscanbeassumedtobe11(=5.52)msec. Assume a very high-speed link between the hosts so that the frame transmission time can be ignored.

(b) Assume that packets arrive at the link layer randomly with the average rate of (1/20) packets/msec and the size of a packet is 2000 bytes.

(c) The header of a frame contains a Sequence number and an ACK number.

(d) Note that the time-out values of timers should be a little greater than RTT, e.g., 15 msec.

(e) Frames may be corrupted or lost during transmission. You may simulate the frame corruption/loss by randomly generating frame corruptions/losses with the frame error probability of pe(0

(f) Assume that the number of re-transmissions Nr = 4, i.e., if a frame is re-transmitted more than Nr, it is dropped.

2. You need to provide the followings for simulation setup. (Ausertypesinthefollowinginformation when a simulation starts.) (a) Number of packets to send

(b) Simulation time (T)

(c) Frame loss/corruption probability (pe)

3. Measure the number of correctly received bytes(B) at Bunder the frame loss/corruption probability pe. And compute the throughput (=B 8/T) for each simulation. You may run many simulations to get the average throughput. 4. Measure the frame transmission delay between the start of frame transmission and the end of successful frame reception for each of a new frame under a pe. You can add them and divide it by the number of successfully received frames during T. You may run many simulations to get the average delay.

5. Plot the average throughput for varying pe.

6. Plot the average delay for varying pe.

7. You may need to run a simulation long enough to collect a reasonable result. (To observe many frame losses/corruptions, the long simulation may be needed for a large.) Youcandecidereasonable T by observing cumulative throughput B8/T vs. T as T increases for a ?xed pe.

Please submit a report containing

11. Please submit a report containing (a) Introduction (b) Block diagram of the program structure

(c) Brief output results showing exchanges of frames(sequence numbers,ACK numbers), occurrences of frame losses/corruptions, and operation of timers.

(d) Plot of the average throughput for varying pe: Average throughput vs. pe (e) Plot of the average delay for varying pe: Average delay vs. pe (f) Observations (g) Conclusion (h) Appendix: Source codes (well-documented)

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

#include 2 3 4 Modified from 5 ALTERNATING BIT AND GO-BACK-N NETWORK EMULATOR: VERSION 1.1 J. F. Kurose 6 inter-datagram time: uniformly random in [e, 2*Lambda] (e.g., Lambda-20) 7 propagation time from A to B: uniformly random in [1, 10] 8 You may determine the time-out value appropriately (e.g., 15) 10 11 #define BIDIRECTIONAL 0 /* Unidirectional 12 13 a datagram "dgm" is the data unit passed from Layer 3 (teachers code) to layer/ 14 2 (students code). It contains the data (characters) to be delivered 15 /*to layer 3 via the students data Link layer protocol entities 16 struct dgm { 17 char data [20]; 18 19 20 a frame is the data unit passed from Layer 2 (students code) to Layer 21 / 1 (teachers code) Note the pre-defined frame structure, which all 22 students must follow. 23- struct frm 24 int seqnum int acknum; int checksum; char payload[20]; 35 26 27 30 STUDENTS WRITE THE NEXT ROUTINES* 31 32 A output 33 called from Layer 3, pass the datagram to be sent to other side 34 A output (datagram) struct dgm datagram; 36 #include 2 3 4 Modified from 5 ALTERNATING BIT AND GO-BACK-N NETWORK EMULATOR: VERSION 1.1 J. F. Kurose 6 inter-datagram time: uniformly random in [e, 2*Lambda] (e.g., Lambda-20) 7 propagation time from A to B: uniformly random in [1, 10] 8 You may determine the time-out value appropriately (e.g., 15) 10 11 #define BIDIRECTIONAL 0 /* Unidirectional 12 13 a datagram "dgm" is the data unit passed from Layer 3 (teachers code) to layer/ 14 2 (students code). It contains the data (characters) to be delivered 15 /*to layer 3 via the students data Link layer protocol entities 16 struct dgm { 17 char data [20]; 18 19 20 a frame is the data unit passed from Layer 2 (students code) to Layer 21 / 1 (teachers code) Note the pre-defined frame structure, which all 22 students must follow. 23- struct frm 24 int seqnum int acknum; int checksum; char payload[20]; 35 26 27 30 STUDENTS WRITE THE NEXT ROUTINES* 31 32 A output 33 called from Layer 3, pass the datagram to be sent to other side 34 A output (datagram) struct dgm datagram; 36

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions