ns-2 contains models for sending Internet traffic over cable modems using the Data Over Cable Service Interface Specification (DOCSIS) specification: https://www.cablemodem.com. These models directly simulate DOCSIS 1.1 and DOCSIS 2.0 links and can be used to simulate DOCSIS 3.0 links and DOCSIS 3.1 SC-QAM links. Channel bonding for DOCSIS 3.x links is simulated by setting the link rate equal to the aggregate link rate for the bonding group.
DelayTb (Link/DelayTb) models a DOCSIS downstream link (from CMTS to the cable modem). More specifically, it models a single downstream service flow providing service to a single cable modem. It takes the following parameters:
rate_ | "Maximum Sustained Traffic Rate": i.e. Token bucket rate (bits/s) |
bucket_ | "Maximum Traffic Burst": i.e. Token bucket maximum size (bytes) |
peakrate_ | "Peak Traffic Rate": i.e. Peak rate token generation rate (bits/s) |
peakbucket_ | Peak rate token bucket maximum rate (bytes): leave at 1522 to model DOCSIS |
As per the DOCSIS 3.0/3.1 specifications, DelayTb uses two token buckets for rate shaping that will accumulate tokens according to their parameters. A departing packet gets the peak or normal transmission rate depending on the available tokens. To model DOCSIS 1.1/2.0, set peakrate_ equal to the line rate.
DocsisLink (Link/DocsisLink) models a DOCSIS upstream link (from cable modem to the CMTS). More specifically, it models a single upstream service flow with best effort scheduling service. It takes the following parameters:
mapint_ | The MAP interval (seconds); typically 2ms |
maxgrant_ | The maximum grant size (bytes) per MAP interval |
mgvar_ | The variability of maximum grant size (0..100: percentage) |
rate_ | Token generation rate (bits/s) |
bucket_ | Token bucket maximum size (bytes) |
peakrate_ | Peak rate token generation rate (bits/s) |
peakbucket_ | Peak rate token bucket maximum rate (bytes) |
DOCSIS's upstream transmission is scheduled at a regular interval called "MAP interval". Before the beginning of each MAP interval, the cable modem receives a grant for how many bytes it can send. This byte count varies as a result of congestion from other users on the shared upstream link; maxgrant_ and mgvar_ are for emulating this congestion. The parameter maxgrant_ is used to cap the average available capacity of the upstream link, and mgvar_ provides a way to simulate the variability of congestion.
The remaining DocsisLink parameters implement the DOCSIS token bucket rate shaping, just like DelayTb.
DocsisLink provides a delay estimate, via the DocsisLink::expectedDelay method, based on the token bucket parameters. It answers "How long will new X bytes take to go through this link?" Some Queue classes that implement AQM algorithms, such as CoDel-Dt and PIE use DocsisLink::expectedDelay, when connected to a DocsisLink, to influence packet drop decisions.