The document contains instructions for implementing three network algorithms in C/C++: 1) An error detecting code using CRC CCIT(16 bits), 2) A distance vector algorithm to find suitable transmission paths, and 3) A congestion control algorithm using the leaky bucket method. Sample code is provided for each algorithm to calculate checksums, routing tables, and regulate output rate based on bucket size.
Insertion Sort is a simple data Sorting algorithm which sorts the array elements by shifting elements one by one and inserting each element into its proper position.
http://www.tutorial4us.com/data-structure/c-insertion-sort
program to convert decimal number into roman number
program of prime number
program to print total number of times a given number exist from 1 to 100
program to compare two given matrices
Insertion Sort is a simple data Sorting algorithm which sorts the array elements by shifting elements one by one and inserting each element into its proper position.
http://www.tutorial4us.com/data-structure/c-insertion-sort
program to convert decimal number into roman number
program of prime number
program to print total number of times a given number exist from 1 to 100
program to compare two given matrices
Ex.1 Write a program to print the following pattern
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ex.2 Write a program to find bigger of three integers.
Ex.3 Write a program to calculate GCD between two numbers.
Ex.4 Write a program to find transpose of matrix.
Ex.5 Write a program which deletes an element from an array & display all other elements.
Ex.6 Write a program to calculate XA+YB where A & B are matrix & X=2, Y=3.
Ex.7 Write a program to calculate the total amount of money in the piggy bank, given that coins of Rs.10, Rs.5, Rs.2, RS.1.
& many more.....
Ex.1 Write a program to print the following pattern
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ex.2 Write a program to find bigger of three integers.
Ex.3 Write a program to calculate GCD between two numbers.
Ex.4 Write a program to find transpose of matrix.
Ex.5 Write a program which deletes an element from an array & display all other elements.
Ex.6 Write a program to calculate XA+YB where A & B are matrix & X=2, Y=3.
Ex.7 Write a program to calculate the total amount of money in the piggy bank, given that coins of Rs.10, Rs.5, Rs.2, RS.1.
& many more.....
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
VTU Network lab programs
1. Networks Laboratory – 10CSL77 PART - B
Implement the following in C/C++:
1. Write a program for error detecting code using CRC CCIT(16 bits).
#include<stdio.h>
#include<string.h>
#define N strlen(g)
char t[128],cs[128],g[]="10001000000100001";
int a,e,c;
void xor()
{
for(c=1;c<N;c++)
cs[c]=((cs[c] == g[c])?'0':'1');
}
void crc()
{
for(e=0;e<N;e++)
cs[e]=t[e];
do{
if(cs[0]=='1')
xor( );
for(c=0;c<N-1;c++)
cs[c]=cs[c+1];
cs[c]=t[e++];
}while(e<=a+N-1);
}
int main()
{
int flag=0;
system("clear");
printf("Enter polynomial:n");
scanf("%s",&t);
printf("Generated divisor is :%sn",g);
a=strlen(t);
for(e=a;e<a+N-1;e++)
t[e]='0';
printf("Modified polynomial is %sn",t);
crc( );
printf("Checksum is :%sn",cs);
for(e=a;e<a+N-1;e++)
t[e]=cs[e-a];
printf("Final codeword is %sn",t);
printf("Test error detection?n1(yes) 0(no):n");
scanf("%d",&flag);
if(flag==0)
return;
if(flag==1)
{
printf("Enter position where error is to be inserted:n ");
scanf("%d",&e);
if(e<a+N-1){
t[e]=(t[e]=='0')?'1':'0';
1 | P a g e A n a n d a K u m a r H N
2. Networks Laboratory – 10CSL77 PART - B
printf("err data : %sn",t);
}
else
printf("Position where error should be created is above the length of Codeword...Hencen");
}
crc();
for(e=0;(e<N-1)&&(cs[e]!='1');e++);
if(e<N-1)
printf("Error detectedn");
else
printf("No error detected n");
return;
}
OUTPUT:
2. Write a program for “distance vector algorithm” to find suitable path for
transmission.
#include<stdio.h>
struct node
{
int dist[20];
int from[20];
}rt[10];
int main()
{
int distance_matrix[20][20];
int n,i,j,k,count=0,src,dest;
printf("nEnter the number of nodes : ");
scanf("%d",&n);
printf("nEnter the cost/distance matrix :n");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
{
scanf("%d",&distance_matrix[i][j]);
distance_matrix[i][i]=0;
rt[i].dist[j]=distance_matrix[i][j];
rt[i].from[j]=j;
}
do
{
count=0;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
2 | P a g e A n a n d a K u m a r H N
3. Networks Laboratory – 10CSL77 PART - B
for(k=0;k<n;k++)
if((rt[i].dist[j])>(distance_matrix[i][k]+rt[k].dist[j]))
{
rt[i].dist[j]=rt[i].dist[k]+rt[k].dist[j];
rt[i].from[j]=k;
count++;
}
} while(count!=0);
for(i=0;i<n;i++)
{ printf("n---------------------------------");
printf("nRouting table for router %d :nDesttNextHopttDistn",i+1);
printf("----------------------------------n");
for(j=0;j<n;j++)
printf("%dt%dtt%dn",j+1,rt[i].from[j]+1,rt[i].dist[j]);
}
printf("nEnter source and destination : ");
scanf("%d%d",&src,&dest);
src--; dest--;
if(rt[src].dist[dest]!=999)
printf("Shortest path : n Via router : %dn Shortest distance : %d n",rt[src].from[dest]+1,rt[src].dist[dest]);
else
printf("no connection exists between %d----->%d",src+1,dest+1);
return 0;
}
6. Write a program for congestion control using leaky bucket algorithm.
#include<stdio.h>
#include<math.h>
int random(int a)
{ int rn=(rand()%10)%a;
return rn==0?1:rn;
}
int main()
{
int packet_sz[5],i,clk,b_size,o_rate,p_sz_rm=0,p_sz,p_time;
for(i=0;i<5;++i)
packet_sz[i]=random(6)*10;
for(i=0;i<5;++i)
printf("packet[%d]:%d bytesn",i,packet_sz[i]);
printf("nEnter the Output rate:");
scanf("%d",&o_rate);
printf("Enter the Bucket Size:");
scanf("%d",&b_size);
for(i=0; i<5; ++i)
{
if((packet_sz[i]+p_sz_rm) > b_size)
if(packet_sz[i] > b_size)
printf("nnIncomming packet size (%d) is Greater than bucket capacity-PACKET REJECTED",packet_sz[i]);
else
3 | P a g e A n a n d a K u m a r H N
4. Networks Laboratory – 10CSL77 PART - B
printf("nnPacket[%d] size %d + Packet remaining %d exceeds Bucket capacity - PACKET
REJECTED!!",i+1,packet_sz[i],p_sz_rm);
else
{
p_sz_rm+=packet_sz[i];
printf("nnIncomming Packet size: %d",packet_sz[i]);
printf("nBytes remaining to Transmit: %d",p_sz_rm);
p_time = random(4)*10;
printf("nTime left for transmission: %d units",p_time);
for(clk=10; clk<=p_time; clk+=10)
{
if(p_sz_rm)
{
if(p_sz_rm <= o_rate)
{
printf("n Packet of size %d Transmitted",p_sz_rm);
p_sz_rm=0;
}
else
{
printf("n Packet of size %d Transmitted",o_rate);
p_sz_rm -= o_rate;
printf("nBytes Remaining after Transmission:%d",p_sz_rm);
}
}
else
printf("n No packets to transmit!!");
printf(" Time Left:%d",p_time-clk);
}
}
}
}
4 | P a g e A n a n d a K u m a r H N