Simulation of Ethernet in C++

Simulation of the Ethernet

This Simulation of the Ethernet C/C++ Project is used 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.

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

 

cbp.cpp file

 

 

stationprocess.c file