Provide a stale diagram that describes the protocol used to transmit data over a
ID: 3697081 • Letter: P
Question
Provide a stale diagram that describes the protocol used to transmit data over an Ethernet cable based on CSMA/CD (Corner Sensing Medium Access/Collision Detection). the 1.1 he met protocol manager the access of many stations to a shared medium for data transmission in a LAN with Bus topology where only one station can transmit data at a time. First, a station (i.e. a computer) connected to a LAN is in Idle state which means that it has no data to transmit. Now. if a station has data to transmit it changes to willing sending stale. If the station is in the later state and it states that the medium ISidle (i.e. free), it can start sending data and it changes to.sending state. While the station in sending state, it keeps 'sensing' the data transmitted (Because other stations may also start sending al the same time, as they all stated 'at the same time' that the medium was free which causes data collision). If a sending station (through its continuous sensing) states that the sending data are different from that it is sensing this means a collision has been occurred, then it aborts data transmission, and it changes to collision detection state. After sending a jam signal other the medium to inform all other stations that a collision has been detected, the station not changes to waiting after collision state. In this state, a back-off algorithm to minimum the number of collisions is executed that determines the time at which the station can retry transmission and a counter that counts the number of transmission retry is incremented Only if the time is arrived, and the number of transmission retry is less than or equal to a given MAXRETRY value. the station can change to the willing sending state. Else if the value of the retry transmission is greater than MAXRETRY. then the station change to transmission cancel state, indicating that there is a problem with the network If the station is in willing sending state and the medium is busy, then it changes to the waiting state While, the station is in waiting state, it senses the medium, and it changes to sending state, once the medium becomes free.Explanation / Answer
import java.io.*;
import java.net.*;
class csma extends Thread
{
Thread t3,t2,t1;
String th;
static int x=0;
csma(String name)
{
super(name);
start();
}
int get(){return x;}
void put(){x++;}
public void run()
{
try
{
int a,b,i=0;
while(true){
a=get();
b=get();
if(a==b) {put();a=get();
System.out.println("a="+a);
th=Thread.currentThread().getName();
System.out.println("Station Transmitting from"+th+" from"+i++);
Thread.sleep(1000);
}
b=get();
System.out.println("b= "+b);
System.out.println("a after sleeps "+a);
if(a!=b){
System.out.println("Station "+th+"Collision OCcured form"+(i-1));
Thread.sleep(1000);
}
else
{
System.out.println("Station"+th+"Success frame "+i);
}
}
}
catch(Exception e){}
}
public static void main(String[] args)
{
csma c1=new csma("A");
csma c2=new csma("B");
csma c3=new csma("C");
while(true);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.