Unable to communicate with ESP8266 CoAP client after uploading arduino sketch.

I am trying to implement CoAP by communicating with ESP8266 using the same. I am using below code:

/*
ESP-COAP Client
*/
#include <ESP8266WiFi.h>
#include "coap_client.h"

//instance for coapclient
coapClient coap;

//WiFi connection info
const char* ssid = "xxxxxxxxxxxxx";
const char* password = "xxxxxxxxxxx" ;


//ip address and default port of coap server in which your interested in
IPAddress ip(129,132,15,80);//take ETH Zurich or coap.me server to run and check client 
int port =5683;

// coap client response callback
void callback_response(coapPacket &packet, IPAddress ip, int port);

// coap client response callback
void callback_response(coapPacket &packet, IPAddress ip, int port) {
    char p[packet.payloadlen + 1];
    memcpy(p, packet.payload, packet.payloadlen);
    p[packet.payloadlen] = NULL;

    //response from coap server
 if(packet.type==3 && packet.code==0){
      Serial.println("ping ok");
    }

    Serial.println(p);
}

void setup() {
   
    Serial.begin(115200);

    WiFi.begin(ssid, password);
    Serial.println(" ");

    // Connection info to WiFi network
    Serial.println();
    Serial.println();
    Serial.print("Connecting to ");
    Serial.println(ssid);
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
    //delay(500);
    yield();
    Serial.print(".");
    }
    Serial.println("");
    Serial.println("WiFi connected");
    // Print the IP address of client
    Serial.println(WiFi.localIP());

    // client response callback.
    // this endpoint is single callback.
    coap.response(callback_response);

    // start coap client
    coap.start();

    //get request to server (arguments ip adrress of server,default port,resource(uri))
    int msgid = coap.get(ip,port,"light");

    //observe request (arguments ip adrress of server,deafult port,resource name,interger(0) ) 
    //int msgid= coap.observe(ip,port,"light",0);

    //reset observe cancel
    //int msgid=coap.observecancel(ip,port,"resoucename");
    
}
//int i=0;

void loop() {
    bool state;
 
    // Requests

    //get request
    //int msgid = coap.get(ip,port,"hello");

    //put request 
    //arguments server ip address,default port,resource name, payload,payloadlength
    //int msgid =coap.put(ip,port,"resourcename","0",strlen("0"));

    //post request
    //arguments server ip address,default port,resource name, payload,payloadlength
    //int msgid =coap.post(ip,port,"resourcename","0",strlen("0"));

    //delete request
    //int msgid = coap.delet(ip,port,"resourcename");

    //ping
    //int msgid=coap.ping(ip,port);
    
    // int msgid=coap.observe(ip,port,"obs",0);
  
    state= coap.loop();
    // Serial.print("state=");
    //Serial.println(state);
    //if(state==true)
          //i=i+1;
  
    //Serial.print("i=");
    //Serial.println(i);
      //if(i==3)
    //{
        //Serial.println("cancel observe");
        //coap.observeCancel(ip,port,"resourcename");
    //}
  
    //Serial.println(msgid);
    delay(1000);
}

I am able to upload sketch successfully to ESP8266 and I recieve message as "172.16121.49" in serial
monitor where as in code the ip address mentioned is (129,132,15,80). I have tried to use coap.me server to crawl CoAP server on both above mentioned ip addresses but it tries four times and then times out.

I have used the above code from the below mentioned url:
ESP-CoAP arduino sketch

Can anyone help me to solve the problem?

The IP address shown on serial monitor is the local IP address of the esp on your local network. It is printed by this line of code:

Serial.println(WiFi.localIP());

If you try to access that ip from a remote server, it will fail because it only exists on your local network. Do you know about firewalls and network address translation (NAT)?

The other IP address is that of the remote CoAP server. I don't know why that does not respond to the coap.me server. This is the first time I have encountered CoAP.

So at this point perhaps everything is normal.

Thanks for the explanation paul but can you tell me how to communicate with esp. You gave me good explanation of both IP's but didn't informed me why I am not able to communicate with esp using the remote server ip?

I am not familiar with CoAP. I do not know what would be normal to see on serial monitor at this point. I can tell that the esp has successfully joined your local WiFi network. But what happens next I do not know. The sketch you are using is clearly a "stub" which you are expected to develop for your application, so perhaps until you begin to do that, nothing more is expected.

Its there a CoAP forum that you could join to request advice?