standard-ethernet
This is a C/C++ simulation project which illustrates the framing of standard ethernet protocol. It creates server and client processes on the same machine and through IPC, it sends the data from client to server in a simplex communication.
Required softwares:
- OS: Linux distro - 64bit.
- Compilers: gcc and g++.
Execution steps:
- Open 2 terminals and navigate both of the terminals to the project directory.
- In the first terminal, run the following command:
cd server g++ -o server FrameDecode.cpp main.cpp ./server
- In the second terminal, run the following command:
cd client g++ -o client FrameEncode.cpp main.cpp ./client
- Perform the operation as per the program prompts.
Expected results:
1. At client end:
Enter the type of destination address:
1. Unicast / Multicast
2. Broadcast
Enter choice: 2
You have chosen broadcast.
Enter the message (payload): Hello! This is so cool!
Preamble:
0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101
SFD:
1010 1011
Destination address:
1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111
Source address:
0100 1010 0011 0000 0001 0000 0010 0001 0001 0000 0001 1010
Type:
1000 0110 1101 1101
Payload:
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0100 1000 0110 0101 0110 1100 0110 1100 0110 1111 0010 0001 0010 0000 0101 0100 0110 1000 0110 1001 0111 0011 0010 0000 0110 1001 0111 0011 0010 0000 0111 0011 0110 1111 0010 0000 0110 0011 0110 1111 0110 1111 0110 1100 0010 0001
CRC:
0000 0000 0000 0000 0000 0000 0111 1010
Final binary frame:
0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 1010 1011 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 0100 1010 0011 0000 0001 0000 0010 0001 0001 0000 0001 1010 1000 0110 1101 1101 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0100 1000 0110 0101 0110 1100 0110 1100 0110 1111 0010 0001 0010 0000 0101 0100 0110 1000 0110 1001 0111 0011 0010 0000 0110 1001 0111 0011 0010 0000 0111 0011 0110 1111 0010 0000 0110 0011 0110 1111 0110 1111 0110 1100 0010 0001 0000 0000 0000 0000 0000 0000 0111 1010
2. At server end:
[INFO] Preamble Validated
[INFO] SFD Validated
[INFO] Destination Address in hexadecimal values:FF:FF:FF:FF:FF:FF
[INFO] Source Address in hexadecimal values:4A:10:10:1A:1A:1A
[INFO] Type [0x86DD]
[INFO] Payload: Hello! This is so cool!
[INFO] Binary Frame:
010101010101010101010101010101010101010101010101010101011010101111111111111111111111111111111111111111111111111101001010001100000001000000100001000100000001101010000110110111010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010010000110010101101100011011000110111100100001001000000101010001101000011010010111001100100000011010010111001100100000011100110110111100100000011000110110111101101111011011000010000100000000000000000000000001111010