Safety Property: NetHardSendBandwidthLimit

property NetHardSendBandwidthLimit(bLimit: int, tLimit: int) {
  // Limit network bandwidth useage to nbytes every timeStep (in milliseconds)
  // Hard limit means that an error is reported whenever the limit is
  // exceeded.

  requires NetworkSendBandwidthCounter;
  postcode RNetwork.initialize () {
    sendTimeSlice = tLimit; 
    sendByteLimit = bLimit;
    sendBytesLeft = bLimit;
  }
  
  check RNetwork.preSend (remote: RNetAddress, nbytes: int) {
    NetHardBandwidthLimitCheck (nbytes, sendBytesLeft, sendByteLimit,
                                sendTimeSlice, "send"); 
  }  
}

About this file

Naccio Home Page
David Evans
University of Virginia, Computer Science