answersLogoWhite

0

#include<stdio.h>

#include<stdlib.h>

#include<signal.h>

#include<sys/time.h>

int x=0;

void capture()

{

exit(0);

}

int get()

{

return x;

}

void put()

{

x++;

}

void node(char *p)

{

int name;

int seq1,seq2,i=0;

long t;

struct timeval tv;

struct timezone tz;

name=atoi(p);

while(1)

{

seq1=get();

seq2=get();

if(seq1==seq2)

{

put();

seq1=get();

gettimeofday(&tv,&tz);

printf("station %d transmitting frame %d at %ld \n",name,++i,tv,tz);

usleep(10);

seq2=get();

if(seq1!=seq2)

{

printf("station %d collision occured %d \n",name,i--);

usleep(100);

}

else

{

printf("station %d transmission of frame %d success \n",name,i);

}

}

usleep(200);

}

}

main()

{

pthread_t t1,t2,t3;

signal(SIGINT,capture);

pthread_create(&t1,0,(void *)node,"1");

pthread_create(&t2,0,(void *)node,"2");

pthread_create(&t3,0,(void *)node,"3");

while(1);

}

User Avatar

Wiki User

11y ago

What else can I help you with?

Continue Learning about Engineering

Which is an access method in which collision is entirely avoided?

Csma/cd


What is Vulnerable time in terms of CSMACD?

CSMA\CD means that when a Clint want to send a signal if is it free it will send the signal and it happens in other Clint at the same time so the signal will crash and then they will try again later after period of time.


Why there is a maximum cable length allowed for CSMA CD?

The CD in CSMA/CD stands for "collision detection." Since multiple devices (potentially) share the same network (the MA or "multiple access" portion of the name) when they are sending data, there must be a way to tell if two devices are trying to send at the same time (a "collision"). The way that a typical CSMA/CD protocol such as Ethernet does this is by having each device "listen" during its own transmission. If it "hears" another device starting to send while it is already sending, it stops and tries again after some delay. Part of this is defining a minimum packet length that is long enough that, for a given length of wire, any given sender can be sure that the beginning message got all the way to the other sender before it assumes there was no collision and that it succeeded in sending the packet. Even at nearly the speed of light, it takes some time for that signal to go down the wire. With 10 Base-T Ethernet (10 million bits/second), the 64 byte minimum would take long enough that the signal could get a kilometer down the line before the first sender was done. With 100 Base-TX, the same minimum only gets 1/10 the distance (100m) because the bits are being sent out ten times faster. With gigabit Ethernet, they actually had to increase the minimum packet length just to make sure that the cable length could stay at 100m.


WHAT is faster CD rom or a CD-rom drive?

boeth. it depends on your computer.


Does burning a CD erase the music from your computer?

No, it does not. It simply copies the music onto your CD.

Related Questions

Which access method is used by Ethernet?

CSMA/CD: Carrier Sense Multiple Access / Collision Detection.


What does the acronym CSMA CD stand for?

The acronym CSMA CD stands for Carrier Sense Multiple Access with Collision Detection. CSMA CD is a set of rules determining how network devices respond when two devices attempt to use a data channel simultaneously.


Which Ethernet standards supports csma CD?

10BaseT


Why csma CD not applicable in mobile ad hoc networks?

Because CSMA/CD does not prevent Hidden terminal problem. so it is onlly applicable in Wired networks.


Which is an access method in which collision is entirely avoided?

Csma/cd


Describe one protocol used for Local Area Network?

IP, appletalk, token ring, CSMA/CD, CSMA/CA


Which is a drawback of the CSMA CD access method?

Collisions can decrease network performance.


What is the difference between csma CD and csma ca - 42k?

*** In CSMA/CD it detects that a collision take place and resend the frame that was send. On a wirless network losing bandwidth along with time to detect that a collision took place was not acceptable , so CSMA/CA was utilized. ** CSMA/CD can achieve above 70% efficiency under heavy loads compared to CSMA/CA that can only achieve up to 30% efficiency under heavy loads. CSMA/CA network: A network in which the medium access control protocol requires carrier sense and where a station always starts transmission by sending a jam signal; if there is no collision with jam signals from other stations, it begins sending data; otherwise, it stops transmission and then tries again later. CSMA/CD network: A bus network in which the medium access control protocol requires carrier sense and in which exception conditions caused by collision are resolved by retransmission


Mechanisms used on Ethernet networks to control access to transmission medium?

Csma/cd


What has the author Bin Lin written?

Bin Lin has written: 'A modified CSMA-CD protocol for high speed channels'


Explain the functioning of the main LAN access control methods?

to access your lan There are a number of different well known access methods: * CSMA/CD * Token passing * Slotted ring The most commont being CSMA/CD (Carrier Sense Multiple Access with Collision Detection) used in the Ethernet LAN environment.


What are three characteristics of CSMACD?

Devices listen to the media and transmit data only when they cannot detect another signal on the media. All devices on the media can hear all communications When a collision occurs, all devices stop transmitting for a randomly generated period of time.