Laynetworks  
Web laynetworks.com Google
Home | Site Map | Tell a friends
Management Tutorials
Download
Tutorials
History
Computer Science
Networking
OS - Linux and Unix
Source Code
Script & Languages
Protocols
Glossary
IGNOU
Quiz
About Us
Contact Us
Feedback
 
Sign up for our Email Newsletter
 
Get Paid for Your Tech Turorials / Tips

 

 

Home > Protocol >  Aloha Protocol > CS 01
 

  Aloha Protocol

 
Page : 1 2 3 4 5 6
 
ALOHA PROTOCOL IN C - LANGUAGE (Updated - inputs by Thilip)
 
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <dos.h>

#define FRAME_TIME 250

main()
{
float S1, S2, G, J, val[100] ;
int I, n, K, delay ;
void wait() ;
clrscr() ;
printf("Please Give the Total Load : ");
scanf("%d", &n);
printf("Please Enter the value of load \n");
for (I=0; I<n; I++)
{
scanf("%f", &val[I]);
}
clrscr();
printf("\nOUTPUT 1: (THROUGHPUT Vs LOADCURVE)\n\n");
printf("s=g*exp(-G) FOR SLOTTED ALOHA * \n");
printf("s=g*exp(-2G) FOR PURE ALPHA #\n");
printf("\n------ (THROUGHPUT PER FRAME TIME)----\n");
for(K=0; K<n; K++)
{
G=val[K];
S1 = G * exp (-G);
S2 = G * exp(-2 * G);
printf("%1.3f", G );
for (I=0; I <=S1*20; I++)
{
printf(" ");
}
printf("*");
for(I=S2*20; I<=S2*75; I++ )
{
printf(" ");
}
printf("#\n");
}
printf("G (ATTEMPTS PER PACKET TIME) \n\n");
wait() ;
getch() ;
clrscr() ;
printf("\nOUTPUT 2 (DELAY Vs THROUGHPUT) \n\n");
printf("\n-----(THOUGHPUT PER FRAME TIME)----\n");
for(K=0; K<n; K++)
{
G=val[K];
S1 = G * exp (-G);
printf("3");
for (I=0; I <=S1*2.7; I++)
{
printf(" ");
}
printf("*\n");
}
printf("\n");
printf("---- DELAY -----");
wait();
getch();
clrscr();
}

void wait()
{
sound(440);
delay(300);
nosound();
}

OUTPUT of (THROUGHPUT V/S LOADCURVE)

s=g*exp(-G) FOR SLOTTED ALOHA *

s-g*exp(-2G) FOR PURE ALPHA #

0.0000003 * #
0.5000003 * #
1.0000003 * #
1.5000003 * #
2.0000003 * #
2.5000003 * #
3.0000003 * #
3.5000003 * #
G (ATTEMPTS PER PACKET TIME)
OUTPUT of (DELAY V/S THROUGHPUT)
 
-----------(THROUGHPUT PER FRAME TIME) ----->
3*

3*

3*

3*

3*

3*

3*

3*

3*
--- DELAY------>
 

Slotted Aloha
Pure Aloha
Aloha and Network Stability
Aloha Simulation & Reservation Aloha Protocol
Slotted ALOHA Simulation Parameters
ALOHA PROTOCOL IN C - LANGUAGE

  1. FDDI Frequently Asked Questions (FAQ)
  2. The function and frame format of FDDI.
  3. Aloha
  4. Comparative analysis between two types of ATM Switches
    a) The Knockout Switch
    b) The Barcher-Banyan Switch
  5. Various popular standards for compressing multimedia data
  6. Distributed Multimedia Survey: Standards
  7. ASCII to hex value chart
  8. Comparative analysis - TCP - UDP
  9. Addressing Formats and QoS parameters
  10. Bellman Ford's Algorithm

TOP

Page : 1 2 3 4 5 6
 
  1. FDDI Frequently Asked Questions (FAQ)
  2. The function and frame format of FDDI.
  3. Aloha
  4. Comparative analysis between two types of ATM Switches
    a) The Knockout Switch
    b) The Barcher-Banyan Switch
  5. Various popular standards for compressing multimedia data
  6. Distributed Multimedia Survey: Standards
  7. ASCII to hex value chart
  8. Comparative analysis - TCP - UDP
  9. Addressing Formats and QoS parameters
  10. Bellman Ford's Algorithm
 
 
Donation | Useful links | Link to Laynetworks.com | Legal | SharePoint Development
Copyright © 2000-2010 Lay Networks All rights reserved.