ICE中地址对重发探测机制

版权声明:本博客为记录本人学习过程而开,内容大多从网上学习与整理所得,若侵权请告知! https://blog.csdn.net/Fly_as_tadpole/article/details/83307813
 if (c->state == PJ_ICE_SESS_CHECK_STATE_WAITING)
 {


     /* See if we shall nominate this check */
     pj_bool_t nominate = (c->nominated || ice->is_nominating); 

     LOG5((ice->obj_name, "Performing triggered check for check %d",i));
     pj_log_push_indent();
     perform_check(ice, &ice->clist, i, nominate);
     pj_log_pop_indent();

 } else if (c->state == PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS) {
     /* Should retransmit immediately
      */
     LOG5((ice->obj_name, "Triggered check for check %d not performed "
    "because it's in progress. Retransmitting", i));
     pj_log_push_indent();
     pj_stun_session_retransmit_req(comp->stun_sess, c->tdata, PJ_FALSE);
     pj_log_pop_indent();

上面程序能够走到这一步,说明双方都应该是处在non_symmertric_NAT之下!

一端A之前发包到另一端B,由于之前另一端B并没有打孔。所以一端A的请求并不能够进入另一端B。但是A的这个发包其实给B后来的发包打了孔!!!

当B向A发包的时候,由于有了孔,因此包可以进行穿越。当A收到B的包时,因为在之前B进行发包被丢弃,但是这个地址对的状态执行perform_check之后变成了IN_PROGRESS状态。因此根据上述的条件会进行立即重发处理!此时也就会形成一个valid_pair!

猜你喜欢

转载自blog.csdn.net/Fly_as_tadpole/article/details/83307813
ice