Skip to content

CarlosSanchess/Data-Link

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instructions for Serial Port Protocol

More context on the project under /docs.

Project Structure

  • bin/: Compiled binaries.
  • src/: Source code for the implementation of the link-layer and application layer protocols. Students should edit these files to implement the project.
  • include/: Header files of the link-layer and application layer protocols. These files must not be changed.
  • cable/: Virtual cable program to help test the serial port. This file must not be changed.
  • main.c: Main file. This file must not be changed.
  • Makefile: Makefile to build the project and run the application.
  • penguin.gif: Example file to be sent through the serial port.

Instructions to Run the Project

1. Edit the Source Code

Edit the source code in the src/ directory.


2. Compile the Application

Compile the application and the virtual cable program using the provided Makefile.


3. Run the Virtual Cable Program

You can either run the executable manually or use the Makefile target:

sudo ./bin/cable_app

or

sudo make run_cable

4. Test the Protocol Without Cable Disconnections and Noise

4.1 Run the Receiver

./bin/main /dev/ttyS11 rx penguin-received.gif

or

make run_tx

4.2 Run the Transmitter

./bin/main /dev/ttyS10 tx penguin.gif

or

make run_rx

4.3 Check if the Received File Matches the Sent File

diff -s penguin.gif penguin-received.gif

or

make check_files

5. Test the Protocol With Cable Disconnections and Noise

  1. Run receiver and transmitter again.
  2. Quickly move to the cable program console and:
    • Press 0 to unplug the cable
    • Press 2 to add noise
    • Press 1 to return to normal mode
  3. Check if the received file matches the sent file, even with cable disconnections or noise.

About

A Data Link Layer protocol in C to enable file transfer between systems over RS-232 serial port connections.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors