Computer Network Unit 1 q what are the topologies in computer n/w ?


Download 392.71 Kb.
bet24/57
Sana09.06.2023
Hajmi392.71 Kb.
#1474191
1   ...   20   21   22   23   24   25   26   27   ...   57
Bog'liq
Computer Network

Ad-hoc network :
"Ad Hoc" is actually a Latin phrase that means "for this purpose." It is often used to describe solutions that are developed on-the-fly for a specific purpose. In computer networking, an ad hoc network refers to a network connection established for a single session and does not require a router or a wireless base station.
For example, if you need to transfer a file to your friend's laptop, you might create an ad hoc network between your computer and his laptop to transfer the file. This may be done using an Ethernet crossover cable, or the computers' wireless cards to communicate with each other. If you need to share files with more than one computer, you could set up a mutli-hop ad hoc network, which can transfer data over multiple nodes.
Basically, an ad hoc network is a temporary network connection created for a specific purpose (such as transferring data from one computer to another). If the network is set up for a longer period of time, it is just a plain old local area network (LAN).


Stop and Wait protocol algorithm ;


Sender side algorithm
Sn=0;
Cansend=true;
While(true)
{
Waitforevent()
If(event(request to send)AND cansend)
{
Getdata();
Makeframe(Sn);
Storeframe(Sn);
Sendframe(Sn);
starttimer()
Cansend=false
}
Waitforevent();
If(event(arrival notificaion))
{
Recieverframe(ackno);
If(ackno==Sn){
Stopttimer();
Purge(Sn-1);
Cansend=true;
}
}
If(event(timeout))
{
Starttimer();
Resendframe(Sn-1);
}
}


Receiver side algorithm
Rn=0;
While(true)
{
Waitfor event();
If(event(arrival notification))
{
Receiveframe();
If(orrupted(frame));
Sleep();
{
Extractdata();
Deliverdata();
Rn =Rn+1;
}
}


Download 392.71 Kb.

Do'stlaringiz bilan baham:
1   ...   20   21   22   23   24   25   26   27   ...   57




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling