Distance Vector Protocol using socket programming in C