problem in Creating UDP connection

hi, everyone, i have some problem
i’m trying to send message from the one Arduino to the other to control it’s LED
by using UDP protocol ,
i think the sender side works perfectly

#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>


#define MSG_INTERVAL 1000


const int push1 = 2;
const int push2 = 3;
int count = 1;

// network parameters
byte mac[] = 
{
  0x90, 0xA2, 0xDA, 0x0E, 0x05, 0x02
};  // ethernet interface MAC address
IPAddress localIp(192, 168, 100, 72);    // local ip address
IPAddress destIp(192, 168, 100, 74);      // destination ip address
unsigned int port = 5678;               // destination port

// EthernetUDP to send and receive messages.
EthernetUDP Udp;

// message string
char message[4] = "NNNN" ;
char message1[4] = "FFFF" ;

// timing
unsigned long previousLedMillis;
unsigned long ledInterval;
unsigned long previousSendMillis;
unsigned long sendInterval;

// setup the arduino and shields
void setup() {

    pinMode(push1, INPUT); 
    pinMode(push2, INPUT);
  
  //Initialize serial and wait for port to open:
  Serial.begin(9600); // 19200
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  // start ethernet and udp
  Ethernet.begin(mac, localIp);   // static ip version
  //if(Ethernet.begin(mac) == 0) {     // dhcp version
  // report failure to obtain network parameters
  // Serial.println("DHCP error");

  // no point in carrying on, loop indefinitely:
  // while(true)
  // ;
  //}

  // open UDP port
  Udp.begin(port);

  // show the local ip address (useful for dhcp)
  Serial.print("Local IP: ");
  Serial.println(Ethernet.localIP());

  // initialize previous millis variables
  previousLedMillis = 0;
  previousSendMillis = 0;

  // initialize send interval
  sendInterval = MSG_INTERVAL;

}

// do tasks
void loop() {
 
  // check if udp string has to be sent
  if (millis() - previousSendMillis >= sendInterval) {
    sendMessage();
  }
}

// send udp string // 
void sendMessage() {
  
//    Serial.println(message);
    
    while((digitalRead(push1) == HIGH) && (digitalRead(push2) == HIGH) ){
      if(count == 1){
        Serial.println("i'm in the LOOP");
        Serial.println("Press on or off");
        count = 0;
     
      }
    }
    
    if(digitalRead(push1) == LOW){
     
      Serial.println("im ON");
      Udp.beginPacket(destIp, port);
     Udp.send(message , destIp, port);
      Udp.endPacket();
      Serial.println("Sending UDP message");
      
     }
     
    else if(digitalRead(push2) == LOW){
     
      Serial.println("OFF");
    Udp.beginPacket(destIp, port);
     Udp.write("FFFF");
      Udp.endPacket();
      Serial.println("Sending UDP message");
    
       }
    
    
  // store current millis
  previousSendMillis = millis();

  // send udp message
  
}

the problem is the receiver doesn’t get the message i don’t know why

#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>


int LED = 8;

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x06
};
IPAddress ip(192, 168, 100, 74);
IPAddress remIp(92, 168, 100, 72);

unsigned int localPort = 123456;      // local port to listen on // 123456

// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;

char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,

void setup()
{
  // start the Ethernet and UDP:
  Ethernet.begin(mac, ip);
  Udp.begin(localPort);
  pinMode(LED, OUTPUT);
  Serial.begin(300);//change and try
  Serial.print("Local IP: ");
  Serial.println(Ethernet.localIP());
}

void loop()
{
  
  int packetSize = Udp.parsePacket();
   Serial.println(packetSize);
  if (packetSize)
  {
    Serial.print("Received packet of size ");
    Serial.println(packetSize);
    Serial.print("From ");
    IPAddress remote = Udp.remoteIP();
    for (int i = 0; i < 4; i++)
    {
      Serial.print(remote[i], DEC);
      if (i < 3)
      {
        Serial.print(".");
      }
    }
    Serial.print(", port ");
    Serial.println(Udp.remotePort());


    // read the packet into packetBufffer
    Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
    Serial.println("Contents:");
    if (strcmp(packetBuffer, "NNNN" ) == 0) {
      digitalWrite(LED, HIGH);
      //delay(5000);
      Serial.println("LED is ON");
      //break;

    }
    else  if (strcmp(packetBuffer, "FFFF" ) == 0) {
      digitalWrite(LED, LOW);
      // delay(5000);
      Serial.println("LED is OFF");
      //break;
    }
    Serial.print("packetBuffer is ");
    Serial.println(packetBuffer); //to check the message
    Serial.print("******************");//to know the end of message
  }

}

I see one problem. Writing "NNNN" sends 4 bytes but not including the terminating NUL. But the receiver uses strcmp() which assumes the string is NUL terminated. Either send the terminating NUL or use memcmp() on the receiver.

Use Wireshark so you will know exactly what is going on the network.

Use netcat (also known as nc) because it can send and receive TCP and UDP. This can be used to test/debug the sender and receiver separately.

If it still not working, post the debug output from both sides.