#include<stdio.h>
int main() {
int windowSize, totalFrames, i;
int frames[50];
// Prompt the user for the sliding window size
printf("Enter window size: ");
scanf("%d", &windowSize);
// Prompt the user for the number of frames to transmit
printf("\nEnter number of frames to transmit: ");
scanf("%d", &totalFrames);
// Prompt the user to enter all the frames
printf("\nEnter %d frames: ", totalFrames);
for(i = 1; i <= totalFrames; i++) {
scanf("%d", &frames[i]);
}
// Display the transmission process
printf("\nSliding Window Protocol Simulation (Assuming No Frame Loss/Corruption)\n");
printf("Sender sends %d frames at a time and waits for acknowledgement.\n\n", windowSize);
for(i = 1; i <= totalFrames; i++) {
// Send frame
printf("%d ", frames[i]);
// Check if the window is full
if(i % windowSize == 0) {
printf("\nAcknowledgement of above frames is received by sender\n\n");
}
}
// If remaining frames are less than window size
if(totalFrames % windowSize != 0) {
printf("\nAcknowledgement of above frames is received by sender\n");
}
return 0;
}
$ gcc gobackN.c
$ ./a.out
Enter window size: 3
Enter number of frames to transmit: 7
Enter 7 frames: 10 20 30 40 50 60 70
Sliding Window Protocol Simulation (Assuming No Frame Loss/Corruption)
Sender sends 3 frames at a time and waits for acknowledgement.
10 20 30
Acknowledgement of above frames is received by sender
40 50 60
Acknowledgement of above frames is received by sender
70
Acknowledgement of above frames is received by sender
1) Implement the data link layer framing methods such as character, character-stuffing and bit stuffing. View Solution
2) Write a program to compute CRC code for the polynomials CRC-12, CRC-16 and CRC CCIP View Solution
3) Develop a simple data link layer that performs the flow control using the sliding window protocol, and loss recovery using the Go-Back-N mechanism. View Solution
4) Implement Dijsktra’s algorithm to compute the shortest path through a network View Solution
5) Take an example subnet of hosts and obtain a broadcast tree for the subnet. View Solution
6) Implement distance vector routing algorithm for obtaining routing tables at each node. View Solution
7) Implement data encryption and data decryption View Solution
8) Write a program for congestion control using Leaky bucket algorithm. View Solution
9) Write a program for frame sorting techniques used in buffers. View Solution
10) Wireshark
i. Packet Capture Using Wire shark
ii. Starting Wire shark
iii. Viewing Captured Traffic
iv.Analysis and Statistics & Filters. View Solution
11) How to run Nmap scan View Solution
12) Operating System Detection using Nmap View Solution
13) Do the following using NS2 Simulator
i. NS2 Simulator-Introduction
ii. Simulate to Find the Number of Packets Dropped
iii. Simulate to Find the Number of Packets Dropped by TCP/UDP
iv. Simulate to Find the Number of Packets Dropped due to Congestion
v. Simulate to Compare Data Rate & Throughput.
vi. Simulate to Plot Congestion for Different Source/Destination
vii. Simulate to Determine the Performance with respect to Transmission of Packets View Solution