Implementing a TCP/IP network protocol for a RISC-V u-kernel -- 2

Job ID: 37349590

Budget: $250 – $750 USD

For this project you need to know very well operating systems, kernel programming, c++, don't make a proposal if you don't have experience.

The project will be divided in 5 deliveries, and the payment will be splited in 5.

For the first delivery you'll have to:

EA1 - Implement a flexible buffer management package, capable of managing a predefined amount of memory to provide all components of the protocol stack with specific size data buffers. Splitting and fusing memory blocks is a strong requirement, as is avoiding to reject memory allocation requests while there is still memory available (even if fragmented). Being efficient and sparse in resource utilization are desirable requirements.

EA2 - Incorporate the branch NIC( https://gitlab.lisha.ufsc.br/epos/ine5424 ) into your current development tree and model a Network Interface Card (NIC) for the SiFive-U machine. The SiFive-U features a Gigabit Ethernet MAC (GEM) NIC from Cadence (datasheet on Moodle) mapped at MIO address 0x10090000. The NIC works exactly in the same way as in the Xilinx Zynq UltraScale+ machine, so you can use the associated documentation, which is more user-friendly than Cadence's or SiFive's, for your development (manual also on Moodle).

So, your task for this lab is to design and implement a preliminary version of the NIC. The design should feature methods for sending and receiving packets similar to those implemented for the PCNet32 NIC and it definitely must incorporate the buffer management component you have developed for EA1. However, it doesn't need to actually send or receive packets yet. Your tests, therefore, can be limited to the flow of data from the APP to the NIC and vice versa. Consider using the Observer design pattern to propagate events such as the arrival of a packet upwards the communication stack.

- P1: NIC (sending)
The NIC Hardware Mediator you designed for EA2 must now be operational. It must be able to marshal Ethernet frames and send them over the network. The buffer management strategy designed for EA1 and incorporated in EA2 must now be fully operational. Demonstrate the functionality of your NIC mediator using a test program that sends data that gets encapsulated in Ethernet frames that are sent over the network and are captured by TCPDump. Submit the diff including such captures at both, the sender and the receiver nodes.

P2: NIC (receiving, interrupt handling, propagation)
Add Ethernet frame receiving and data up forwarding to your current NIC Hardware Mediator implementation. Receiving Ethernet frames is a process triggered by the network, not by the application. The NIC receives Ethernet frames and raises interrupts. The NIC Mediator interrupt handler acts upon the buffer containing the received Ethernet frame and signalizes the test application. Demonstrate the functionality of your NIC mediator using a test program that sends data that gets encapsulated in Ethernet frames that are sent over the network and are received by the peer node. Capture the traffic using TCPDump and submit those captures along with the code on a single diff file.

So first you need to make EA1, then EA2, and then you will be able to make P1 and then P2.

The others deliveries will be presented later after the first one completed.