Wednesday, April 6, 2011

SLIDING WINDOW PROTOCOL


sliding window protocol is a feature of packet-based data transmission protocols. Sliding window protocols are used where reliable in-order delivery of packets is required, such as in the Data Link Layer (OSI model) as well as in the Transmission Control Protocol (TCP).
Conceptually, each portion of the transmission (packets in most data link layers, but bytes in TCP) is assigned a unique consecutive sequence number, and the receiver uses the numbers to place received packets in the correct order, discarding duplicate packets and identifying missing ones. The problem with this is that there is no limit of the size of the sequence numbers that can be required.
By placing limits on the number of packets that can be transmitted or received at any given time, a sliding window protocol allows an unlimited number of packets to be communicated using fixed-size sequence numbers.
For the highest possible throughput, it is important that the transmitter is not forced to stop sending by the sliding window protocol earlier than one round-trip delay time (RTT). The limit on the amount of data that it can send before stopping to wait for an acknowledgment should be larger than the bandwidth-delay product of the communications link. If it is not, the protocol will limit the effective bandwidth of the link.

DOMAIN NAME SERVER OR SYSTEM (DNS)


  • Short for Domain Name System (or Service or Server), an Internet service that translates domain names into IP addresses. Because domain names are alphabetic, they're easier to remember. The Internet however, is really based on IP addresses. Every time you use a domain name, therefore, a DNS service must translate the name into the corresponding IP address. For example, the domain name www.example.com might translate to 198.105.232.4.
  • The DNS system is, in fact, its own network. If one DNS server doesn't know how to translate a      particular domain name, it asks another one, and so on, until the correct IP address is returned.
  • Short for digital nervous system, a term coined by Bill Gates to describe a network of personal computers that make it easier to obtain and understand information.

INTERNET

The Internet, sometimes called simply "the Net," is a worldwide system of computer networks - a network of networks in which users at any one computer can, if they have permission, get information from any other computer (and sometimes talk directly to users at other computers). It was conceived by the Advanced Research Projects Agency (ARPA) of the U.S. government in 1969 and was first known as the ARPANET. The original aim was to create a network that would allow users of a research computer at one university to be able to "talk to" research computers at other universities. A side benefit of ARPANet's design was that, because messages could be routed or rerouted in more than one direction, the network could continue to function even if parts of it were destroyed in the event of a military attack or other disaster.

INTRANET


Intranet is the generic term for a 
collection of private computer networks 
within an organization. An intranet uses 
network technologies as a tool to 
facilitate communication between people 
or workgroups to improve the data 
sharing capability and overall knowledge 
base of an organization's employees.

WWW

A technical definition of the World Wide Web is: all the resources and users on the Internet that are using the Hypertext Transfer Protocol (HTTP).
A broader definition comes from the organization that Web inventor Tim Berners-Lee helped found, the World Wide Web Consortium (w3c):
"The World Wide Web is the universe of network-accessible information, an embodiment of human knowledge."

Friday, April 1, 2011

LEXICAL ANALYSER


#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
main()
{
char buff[30],c,ch;
char key[5][10]={"int\0","char\0","float\0","main\0"};
FILE *fp;
int i,j,k,l,m;
clrscr();
fp=fopen("add.c","r");
while(1)
{
ch=fgetc(fp);
c=ch;
if(c==EOF)
break;
if(c=='+'||c=='-'||c=='*'||c=='/')
{
buff[0]=c;
c=fgetc(fp);
if(c=='+'||c=='-'||c=='=')
printf ("%c%c\t is operator\n",buff[0],c);
else
{
printf("%c is operator\n",buff[0]);
fseek(fp,0,-1);
}
}
else if(c=='=')
{
buff[0]=c;
c=fgetc(fp);
if(c=='=')
printf("%c%c\t is comparision\n",buff[0],c);
else
{
printf("%c is assignment\n",buff[0]);
fseek(fp,0,-1);
}
}
else if(isdigit(c))
{
i=0;
buff[i]=c;
c=fgetc(fp);
while (isdigit(c))
{
i++;
buff[i]=c;
c=fgetc(fp);
}
for(k=0;k<=i;k++)
{
printf("%c",buff[k]);
}
printf("\t is number\n");
fseek(fp,0,-1);
}
else if(isalnum(c))
{
m=0;
i=0;
do
{
buff[i]=c;
c=fgetc(fp);
i++;
}while(isalnum(c));
buff[i]='\0';
for(j=0;j<4;j++)
{
if(strcmp(buff,key[j])==0)
{
m=1;
printf(" %s is key word\n",buff);
break;
}
}
if(strcmp(buff,key[j])!=0)
{
printf(" %s is a identifier\n",buff);
}
fseek(fp,0,-1);
}
}
fclose(fp);
getch();
}


RECURSIVE PARSING


#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
char input[10];
int i=0;
void t();
void eprime();
void f();
void tprime();
void e()
{
if(input[i+1]=='+')
eprime();
else if(input[i+1]=='*')
{
t();
e();
}
else if(input[i]=='\0')
printf("string not accepted");

else
{
f();
e();
}
}
void t()
{
if(input[i+1]=='*')
tprime();
else if(input[i]=='\0')
printf("string not accepted");
else
f();
}
void f()
{
if(input[i]=='(')
{
i++;
e();
}
else if(input[i]==')' && input[i+1]=='\0')
printf("string is accepted");
else if(input[i]=='I')
{
i++;
if(input[i]=='\0'||input[i]==')')
{
printf("string is accepted");
exit(0);
}
}
}
void eprime()
{
f();
i++;
e();
}
void tprime()
{
f();
i++;
e();
}
main()
{
clrscr();
printf("enter the string replacing id with I\n");
scanf(" %s",input);
e();
getch();
}

3ADDRESS CODE


#include<stdio.h>
#include<ctype.h>
main()
{
char expr[20],stack[20];
int i,top=0,k=0,num[20];
printf("enter the postfix expression\n");
scanf("%s",&expr);
for(i=0;expr[i]!='\0';i++)
if(isalnum(expr[i]))
stack[top++]=expr[i];
else
{
printf("T%d=",k);
if(stack[top-2]=='T')
printf("%c%d",stack[top-2],num[top-2]);
else
printf("%c",stack[top-2]);
printf("%c",expr[i]);
if(stack[top-1]=='T')
printf("%c%d",stack[top-1],num[top-1]);
else
printf("%c",stack[top-1]);
printf("\n");
top=top-2;
stack[top]='T';
num[top++]=k++;
}
}