This is a C/C++ simulation project which illustrates the framing of standard ethernet protocol

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:

  1. OS: Linux distro - 64bit.
  2. Compilers: gcc and g++.

Execution steps:

  1. Open 2 terminals and navigate both of the terminals to the project directory.
  2. In the first terminal, run the following command:
    cd server
    g++ -o server FrameDecode.cpp main.cpp
    ./server
  3. In the second terminal, run the following command:
    cd client
    g++ -o client FrameEncode.cpp main.cpp
    ./client
  4. 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
Owner
P Punyacharan
A passionate computer science engineer.
P Punyacharan
Similar Resources

Variadic recursive expression templates which look like ordinary (possibly nested) containers.

Variadic resursive expressions with lazy evaluation which look like nested containers LazyExpression is a header-only library written in C++17. It imp

Dec 23, 2022

A custom,multifunctional class template for arrays which supports lambda functions for removing and selecting

C++ Array Template Class This is an implementation of a template class for storing data in any type.It includes user-friendly interface with lots of h

Dec 8, 2021

Hello, I am creating this file to make everyone understand the basis of C++ language which is actually the advanced version of C but better than C because of its OOPs feature.

Hello-in-C++ 😄 😄 FOR BEGINNERS IN C++ Hello, I am creating this file to make everyone understand the basics of C++ language which is actually the ad

Dec 27, 2021

A curated list of project-based tutorials in C

A list of tutorials that work towards the making of small to large projects in C.

Feb 13, 2022

A simple messenger written in C for Principal of Programming course final project

A simple messenger written in C for Principal of Programming course final project

Mohsenger A simple messenger written in C for Principal of Programming course final project Implemented by socket and sqlite3 dbms and single thread c

Sep 25, 2021

My solution for the push_swap project of 42 school.

My solution for the push_swap project of 42 school.

push_swap 86/100 This is my solution for the push_swap project of 42 school. This code is capable of handeling inputs that look like "2 1 3 4 5" or 2

Jun 20, 2022

Project for C programming class building a casino that includes blackjack, slots, and scratch offs.

Casino Project for C programming class building a casino that includes blackjack, slots, and scratch offs. Project description This project will requi

Nov 4, 2021

This is a C project, to find the weekly salary of your employees.

Weekly-Salary This is a C project, to find the weekly salary of your employees. This is a very simle project. At 1st you insert the code of the employ

Dec 3, 2021

Final project for intro to programming; CSCI 1300

CarmenSandiegoGame HOW TO COMPILE AND RUN Compile: g++ -std=c++11 videoGame.cpp unity.cpp Run: ./a.out DEPENDENCIES Game.h Hacker.h Npc.h Map.h Store.

Dec 6, 2021
Ideas, thoughts, and notes on a typeclass/interface based polymorphism pattern for standard C

Polymorphism through Typeclasses / Interface / Traits Ideas, thoughts, and notes on an action based polymorphism pattern for good ol' C. Originally us

Jan 1, 2023
This is a simple UNITEST to test the implementation of the the various container types of the C++ standard template library

ft_container UNITest. This is a simple UNITEST to test the implementation of the the various container types of the C++ standard template library that

Dec 27, 2022
C++ Type Traits for Smart Pointers that are not included in the standard library, containing inheritance detection and member detection.
C++ Type Traits for Smart Pointers that are not included in the standard library, containing inheritance detection and member detection.

Smart Pointer Type Trait ?? A simple, header-only cpp library implementing smart pointer type traits. You can easily compile your code diffrently depe

Sep 14, 2022
Simulation code for the specific PDP-10 serial number 32 at the Stanford A. I. Lab in 1974 as a solo processor with all the I/O devices simulated as on the PDP-10. Omit the co-processor PDP-6 sn16.
Simulation code for the specific PDP-10 serial number 32 at the Stanford A. I. Lab in 1974 as a solo processor with all the I/O devices simulated as on the PDP-10. Omit the co-processor PDP-6 sn16.

KA10 sn32 Synopsis This repository contains software and documentation for running the unique PDP-10 KA serial number 32 that was at Stanford in July

Aug 7, 2021
Implementation of kcp protocol based on c++11
Implementation of kcp protocol based on c++11

?? kcp-cpp A C++11 header-only kcp library,It has been heavily optimized to support native heartbeat packets and multithreading There are a lot of ins

Oct 25, 2022
Minimal Linux Live (MLL) is a tiny educational Linux distribution, which is designed to be built from scratch by using a collection of automated shell scripts. Minimal Linux Live offers a core environment with just the Linux kernel, GNU C library, and Busybox userland utilities.
Minimal Linux Live (MLL) is a tiny educational Linux distribution, which is designed to be built from scratch by using a collection of automated shell scripts. Minimal Linux Live offers a core environment with just the Linux kernel, GNU C library, and Busybox userland utilities.

Minimal Linux Live (MLL) is a tiny educational Linux distribution, which is designed to be built from scratch by using a collection of automated shell scripts. Minimal Linux Live offers a core environment with just the Linux kernel, GNU C library, and Busybox userland utilities.

Jan 8, 2023
This is an active mirror of the KiCad development branch, which is hosted at GitLab

This is an active mirror of the KiCad development branch, which is hosted at GitLab (updated every time something is pushed). Pull requests on GitHub are not accepted or watched.

Jan 4, 2023
This repo is for competitive coders. In the readme file you will get the list of questions. You can contribute by adding your solutions or by providing the optimized solutions which are answered already.
This repo is for competitive coders. In the readme file you will get the list of questions. You can contribute by adding your solutions or by providing the optimized solutions which are answered already.

Hello, Problem Solvers !!! ?? What it's about? ??‍?? This repository is for Competitive Coders to get started with Open-source. ?? We have curated a l

Oct 22, 2022
C++20 Concepts IO library which is 10x faster than stdio and iostream

fast_io fast_io is a new C++20 library for extremely fast input/output and aims to replace iostream and cstdio. It is header-only (module only in the

Feb 16, 2022
A high level programming language which compiles to C.
A high level programming language which compiles to C.

What is Stilts? The goal of this project is to create a language that's nice to work with, looks and feels like Java, but maps to low level C code wit

Jan 7, 2023