To send data we need to use a PBUF of the correct type and size and store the data in its payload field: char message[] = "Hello UDP World"; struct pbuf *p = pbuf ...