mitre decbit changes
authorKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Wed, 17 Jan 1990 15:10:06 +0000 (07:10 -0800)
committerKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Wed, 17 Jan 1990 15:10:06 +0000 (07:10 -0800)
SCCS-vsn: sys/netiso/tp_subr.c 7.5
SCCS-vsn: sys/netiso/tp_pcb.c 7.5
SCCS-vsn: sys/netiso/tp_emit.c 7.4

usr/src/sys/netiso/tp_emit.c
usr/src/sys/netiso/tp_pcb.c
usr/src/sys/netiso/tp_subr.c

index 7253fa9..40cd101 100644 (file)
@@ -29,7 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_emit.c,v 5.5 88/11/18 17:27:20 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_emit.c,v $
  *
  * $Header: tp_emit.c,v 5.5 88/11/18 17:27:20 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_emit.c,v $
- *     @(#)tp_emit.c   7.3 (Berkeley) %G% *
+ *     @(#)tp_emit.c   7.4 (Berkeley) %G% *
  *
  * This file contains tp_emit() and tp_error_emit(), which
  * form TPDUs and hand them to ip.
  *
  * This file contains tp_emit() and tp_error_emit(), which
  * form TPDUs and hand them to ip.
@@ -200,6 +200,15 @@ tp_emit(dutype,    tpcb, seq, eot, data)
 
                case CR_TPDU_type:
                        hdr->tpdu_CRdref_0 = htons(0);  /* must be zero */
 
                case CR_TPDU_type:
                        hdr->tpdu_CRdref_0 = htons(0);  /* must be zero */
+                       if (!tpcb->tp_cebit_off) {
+                               tpcb->tp_win_recv = tp_start_win << 8;
+                               LOCAL_CREDIT(tpcb);
+                               CONG_INIT_SAMPLE(tpcb);
+                               tpcb->tp_ackrcvd = 0;
+                       }
+                       else
+                               LOCAL_CREDIT(tpcb);
+
 
                case CC_TPDU_type: 
                                {
 
                case CC_TPDU_type: 
                                {
@@ -208,7 +217,9 @@ tp_emit(dutype,     tpcb, seq, eot, data)
                                hdr->tpdu_CCsref =  htons(tpcb->tp_lref); /* same as CRsref */
 
                                if( tpcb->tp_class > TP_CLASS_1 ) {
                                hdr->tpdu_CCsref =  htons(tpcb->tp_lref); /* same as CRsref */
 
                                if( tpcb->tp_class > TP_CLASS_1 ) {
-                                       LOCAL_CREDIT( tpcb ); 
+/* ifdef CE_BIT, we did this in tp_input when the CR came in */
+                                       if (tpcb->tp_cebit_off)
+                                               LOCAL_CREDIT( tpcb );
                                        tpcb->tp_sent_uwe = tpcb->tp_lcredit -1;
                                        tpcb->tp_sent_rcvnxt = 1;
                                        tpcb->tp_sent_lcdt = tpcb->tp_lcredit;
                                        tpcb->tp_sent_uwe = tpcb->tp_lcredit -1;
                                        tpcb->tp_sent_rcvnxt = 1;
                                        tpcb->tp_sent_lcdt = tpcb->tp_lcredit;
index 9e4cbd3..9cb53f6 100644 (file)
@@ -29,7 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_pcb.c,v 5.4 88/11/18 17:28:24 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_pcb.c,v $
  *
  * $Header: tp_pcb.c,v 5.4 88/11/18 17:28:24 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_pcb.c,v $
- *     @(#)tp_pcb.c    7.4 (Berkeley) %G% *
+ *     @(#)tp_pcb.c    7.5 (Berkeley) %G% *
  *
  *
  * This is the initialization and cleanup stuff - 
  *
  *
  * This is the initialization and cleanup stuff - 
@@ -355,6 +355,8 @@ tp_init()
        /* FOR ISO */
        tp_isopcb.isop_next = tp_isopcb.isop_prev = &tp_isopcb;
 
        /* FOR ISO */
        tp_isopcb.isop_next = tp_isopcb.isop_prev = &tp_isopcb;
 
+    tp_start_win = 2;
+
        tp_timerinit();
        bzero((caddr_t)&tp_stat, sizeof(struct tp_stat));
        return 0;
        tp_timerinit();
        bzero((caddr_t)&tp_stat, sizeof(struct tp_stat));
        return 0;
index d11580f..145d870 100644 (file)
@@ -29,7 +29,7 @@ SOFTWARE.
  *
  * $Header: tp_subr.c,v 5.3 88/11/18 17:28:43 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_subr.c,v $
  *
  * $Header: tp_subr.c,v 5.3 88/11/18 17:28:43 nhall Exp $
  * $Source: /usr/argo/sys/netiso/RCS/tp_subr.c,v $
- *     @(#)tp_subr.c   7.4 (Berkeley) %G%
+ *     @(#)tp_subr.c   7.5 (Berkeley) %G%
  *
  * The main work of data transfer is done here.
  * These routines are called from tp.trans.
  *
  * The main work of data transfer is done here.
  * These routines are called from tp.trans.
@@ -137,6 +137,7 @@ tp_goodXack(tpcb, seq)
                                        0,0,0);
                        ENDTRACE
                        sbdrop( &tpcb->tp_Xsnd, (int)(tpcb->tp_Xsnd.sb_cc));
                                        0,0,0);
                        ENDTRACE
                        sbdrop( &tpcb->tp_Xsnd, (int)(tpcb->tp_Xsnd.sb_cc));
+                       CONG_ACK(tpcb, seq);
                        return 1;
        } 
        return 0;
                        return 1;
        } 
        return 0;
@@ -240,17 +241,17 @@ tp_goodack(tpcb, cdt, seq, subseq)
                /* increase congestion window but don't let it get too big */
                {
                        register int maxcdt = tpcb->tp_xtd_format?0xffff:0xf;
                /* increase congestion window but don't let it get too big */
                {
                        register int maxcdt = tpcb->tp_xtd_format?0xffff:0xf;
-                       
-                       if( ++tpcb->tp_cong_win > maxcdt )
-                               tpcb->tp_cong_win = maxcdt; 
+                       CONG_ACK(tpcb, seq);
                }
 
                /* Compute smoothed round trip time.
                 * Only measure rtt for tp_snduna if tp_snduna was among 
                }
 
                /* Compute smoothed round trip time.
                 * Only measure rtt for tp_snduna if tp_snduna was among 
-                * the last TP_RTT_NUM seq numbers sent.
+                * the last TP_RTT_NUM seq numbers sent, and if the data
+                * were not retransmitted.
                 */
                if (SEQ_GEQ(tpcb, tpcb->tp_snduna, 
                 */
                if (SEQ_GEQ(tpcb, tpcb->tp_snduna, 
-                       SEQ(tpcb, tpcb->tp_sndhiwat - TP_RTT_NUM))) {
+                       SEQ(tpcb, tpcb->tp_sndhiwat - TP_RTT_NUM))
+                       && SEQ_GT(tpcb, seq, SEQ_ADD(tpcb, tpcb->tp_retrans_hiwat, 1))) {
 
                        struct timeval *t = &tpcb->tp_rttemit[tpcb->tp_snduna & TP_RTT_NUM];
                        struct timeval x;
 
                        struct timeval *t = &tpcb->tp_rttemit[tpcb->tp_snduna & TP_RTT_NUM];
                        struct timeval x;
@@ -318,6 +319,7 @@ tp_goodack(tpcb, cdt, seq, subseq)
                        }
                }
                tpcb->tp_snduna = seq;
                        }
                }
                tpcb->tp_snduna = seq;
+               tpcb->tp_retrans = tpcb->tp_Nretrans; /* CE_BIT */
 
                bang++;
        } 
 
                bang++;
        }