Ethernet: Communication between LLC and Higher Layers

Ethernet: Communication between LLC and Higher Layers

Higher layers (applications or protocols) talk to the EtherLLC module in the following way.

When a higher layer wants to send a packet via Ethernet, it just passes the data packet (a cPacket or any subclass) to EtherLLC. The message kind has to be set to IEEE802CTRL_DATA.

In general, if EtherLLC receives a packet from the higher layers, it interprets the message kind as a command. The commands include IEEE802CTRL_DATA (send a frame), IEEE802CTRL_REGISTER_DSAP (register highher layer) IEEE802CTRL_DEREGISTER_DSAP (deregister higher layer) and IEEE802CTRL_SENDPAUSE (send PAUSE frame) -- see EtherLLC for a more complete list.

The arguments to the command are in an Ieee802Ctrl control info object, attached to the packet (see the getControlInfo() method of cPacket.)

For example, to send a packet to a given MAC address and protocol identifier, the application sets the data packet's message kind to ETH_DATA ("please send this data packet" command), fills in the Ieee802Ctrl structure with the destination MAC address and the protocol identifier, adds the control info to the message, then sends the packet to EtherLLC.

When the command doesn't involve a data packet (e.g. IEEE802CTRL_(DE)REGISTER_DSAP, IEEE802CTRL_SENDPAUSE), a dummy packet (empty cMessage) is used.