Pass the frame from the Link layer to the Physical Layer

748 views Asked by At

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 ?

2

There are 2 answers

4
code monkey On

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:

  • Communication Upper Layer to Lower Layer: use function parameters
  • Communication Lower Layer to Upper Layer: use callback functions

Designing protocols is not trivial and you should keep it simple in the first approaches.

1
k.ratty On

you need to use a sockets code ,A socket is one end-point of a two-way communication link between two programs running on the network link. Socket classes are used to represent the connection between a client program and a server program. you do not need to program the physical layer, the OS care with . http://www.tutorialspoint.com/java/java_networking.htm