The lwIP provides two APIs for use by applications:
RAW API: The raw API is customized for high performance and lower memory overhead. The limitation of raw API is that it is callback-based, and consequently does not provide portability to other TCP stacks.
Best Performance & Code Size
Complex For Application Development
Socket API: The socket API provides a BSD socket-style interface and is very portable; however, this mode is not as efficient as raw API mode in performance and memory requirements.
BSD Socket-style API → (Open-Read-Write-Close)
Very Portable