안녕하세요.. HDLC ARQ Go-back-n 알고리즘 도와주세요.
염소자리
//************************************************************ // // methods implementing logic of go-back-n ARQ // these were in dllogic.cpp in C++ NW
/** tests whether range between two numbers is smaller than * the window (DLC_WINDOW_FRAMES), given DLC counter range (DL_WINDOW_MAX) * Nmin is logically lower end of range, the lowest number not ACKed * Nmax is logically higher end of range, the next number to be used */ boolean LTwindow(int Nmin, int Nmax) { int testmax=Nmax; if(Nmin Nmax) testmax = testmax+DL_WINDOW_MAX; return(testmax-Nmin DL_WINDOW_FRAMES); }
/** tests whether range between two numbers is within the * window (DLC_WINDOW_FRAMES), given DLC counter range (DL_WINDOW_MAX) * Nmin is logically lower end of range, the lowest number not ACKed * Nmax is logically higher end of range, the next number to be used */ boolean INwindow(byte Nmin, byte Nmax) { //// student replaces FALSE with appropriate code int testmax=Nmax; if(Nmin Nmax) testmax = testmax-DL_WINDOW_MAX; return(testmax-Nmin = DL_WINDOW_FRAMES); //return false; }
/** tests whether the window has become full * SNmin is SN of the lowest frame sent and not ACKed * SNmax is one greater (mod DL_WINDOW_MAX) than SN of * highest frame sent and not acked */ boolean window_full(int SNmin, int SNmax) { //// student replaces FALSE with appropriate code
return false; }
/** tests whether frames have been sent for which ACKs * have not been received * SNmin is SN of the lowest frame sent and not ACKed * SNmax is one greater (mod DL_WINDOW_MAX) than SN of * highest frame sent and not acked */ boolean frames_remain_unacked(int SNmin, int SNmax) { //// student replaces FALSE with appropriate code return false; }
/** returns incremented SNmax for an interface within * the modular range, which is of size DL_WINDOW_MAX */ int increment_SNmax(int SNmax) { //// student replaces 0 with appropriate code return SNmax + SNmax%3; }
/** returns updated value of SNmin in HDLCState */ int update_SNmin(int newSNmin) { //// student replaces 0 with appropriate code return 0; }
/** updates the RN of interface, * based on received SN */ int update_RN(int received_SN) { //// student replaces 0 with appropriate code return 0; }
/** tests whether to accept frame, based on its SN and the RN associated with receiving interface*/ boolean accept_frame(int received_SN,int interface_RN) { //// student replaces FALSE with appropriate code return false; } }// end class HDLC위에껀 어찌어찌 했는데 밑에 부분이 영 이해가 가지 않네요.. ㅜㅜ혹시 괜찮으시다면 조언좀 해주세요.감사합니다.코드가 다 필요하시면 올려드릴께요.