I'm trying to create a simple Link layer protocol for school.
I've been searching and googling and I understand that Link layer has pas the frame I create to the Physical layer, but how to do in Programming (language c) is there a function or library that I can use to send my frame directly using Physical layer ? or how should it be done ?
The most common design patterns to develop communication protocols are the Protocol Stack Design Pattern and the Protocol Layer Design Pattern. Take a look at it. The links have some example code.
In summary it works as following:
Designing protocols is not trivial and you should keep it simple in the first approaches.