Simulation of the Ethernet C Project

Simulation of the Ethernet

This Simulation of the Ethernet C Project is to simulate the Ethernet model explained in the class room. In this project, I was able to implement the interaction of Station-Process (SP) with the Communication Bus Process (CBP) through Socket programming. 

The SP is developed in C and the CBP is developed in C++. TCP is the transport protocol implemented for this project. In this project, when both SP and CBP are activated, any file sent on Station Process will be displayed on CBP.

Readme File:

For compiling and executing the project, below are the commands:

Compile CBP file:

g++ -pthread cbp.cpp

Execute:

./a.out 7000   (we can use any port number instead of 7000 here)

Compiling SP file:

gcc  stationprocess.c

Execute:

./a.out  cbpname cbp_port-no file_requested

Eg:          ./a.out cbp 7000 data.txt

To view output: vi slogfile

Simulation Results:

g++ -pthread cbp.cpp

./a.out 7000

Socket created 4

Socket binded

Waiting for data on port….

gcc  stationprocess.c

./a.out cbp 7000 data.txt

Host not foundRead 28 bytes that are [void bal(float amount);
 ]
Read 0 bytes that are []
Total Bytes Read = 28

Download Simulation of the Ethernet C Project with source code

2 Replies to “Simulation of the Ethernet C Project”

Leave a Reply

Your email address will not be published. Required fields are marked *