This is a discussion continued from another thread. But we were starting to hijack the thread and go off-topic, so I figured I would start a new one with all the information I discovered about how docsis cable modems work. I hope you enjoy... and if I made a mistake anywhere let me know!
After doing further research into the topic, it appears that this is how the all cablelabs docsis approved modems work:
1) Cable modem is powered on. It sends out a BOOTP request. The CMTS on the cable provider's side will send a BOOTP reply that contains various information such as a config file name, tftp server, time server, syslog server, etc.
2) The cable modem looks at the BOOTP reply with all that nice information, and uses it in the following way:
- It connects to the TFTP server, and downloads the config file mentioned.
- It uses the time server to update it's clock (considering that it doesn't know the correct time when it boots up). This allows for accurate logs that can be sent to the syslog server.
3) The config file is a binary file that is written specifically for DOCSIS modems. I can give you samples of one, but there are plenty online. There is also a free tool on sourceforge that allows encoding/decoding of config files (
http://docsis.sourceforge.net). The config file must be binary so that the cable modem can read it, so in order to edit an existing config file you might use that tool to decode it first. The config file contains information such as:
- NetworkAccess: this is a value set to 0 or 1 which defines if the modem can access the ISPs network and pass on DHCP requests and what not.
- MaxCPE: this defines how many CPE devices that can exist on the customer's side. In many cases, it's only 1 (so you can't get more than 1 public IP!)... but often times cable ISPs allow more than 1 just to alleviate the complaining customers who can't get an IP because they switched computers (new NIC) or something similar... and never restarted the modem to clear the cpe mac address ties. Lucky for me, my ISP allows for around 7-10 CPE devices. So yes, I can get that many public IPs. This is most likely a problem on their end considering I am a residential customer, but I am not going to say anything :). Plus, they know exactly how many CPE devices you are currently using, and I can assure you that logs are kept. So don't do anything that is going to get your internet shut off.
- Speeds: This isn't an exact variable, but in general, the config file also specifies what speeds (upload, download) your modem can have. This is where we get into spoofing the TFTP server so you can generate a custom config file, and uncap your speeds! Yes, it is possible to use your own config file, but it is very hard nowadays. Cable modem "speed uncapping" was a popular concept back in the day with particular modems, so if you wan't to know more about it and how it's done, do a Google search. But as of today, it's pretty tough to do (although it's still possible). It basically involves spoofing the tftp server so that your modem downloads a config file from you, rather than from the ISP. Be warned, this is another thing that will probably get your service terminated if you do it. They know how much bandwidth you're using, they aren't stupid! If you're using 10MBps when your account is only specified for 2MBps, you're going to get in trouble.
- The config file contains a lot of other cool information, but doing some Google searches can tell you more about what it contains.
4) So now you're modem is powered on and it has a config file! If NetworkAccess is set to 1 in the config file, your modem is authorized to talk on the ISP's cable modem network, and can relay DHCP requests from any client devices connected to the modem. You can get as many DHCP leases for your client devices up to whatever MaxCPE was set to. Once a CPE device has a public IP, you are officially online. Congratulations.
Other useful information/clarifications:
- The config file that you download is determined by your HFC MAC address. So when your modem sends that BOOTP request, the CMTS looks at the HFC MAC address and says: "oh, that's a residential customer. he gets the config file residential.bin which allows for 3MBps/256Kbps, with a maximum of 2 CPE devices!". The CMTS may also say "I don't recognize this MAC as a customer!... he get's disabled.bin which gives him no network access and 0 MaxCPE devices!"
- Docsis modems are required to make use of snmp. This can allow the customer to see useful information such as the tftp server's IP address, config file name, etc. that is normally not visible on the ethernet side of the modem. Docsdiag is a good/free tool for querying such information from the modem. However, the docsis config file can specify that only certain IP ranges can request to see the snmp info, thus blocking out customers from getting the data. My ISP does this; however, they didn't a while ago when docsdiag worked perfectly :P. I guess they are learning how to better secure themselves.
- Docsis has many versions: 1.x, 2.0, 3.0... and all may have slightly different ways of operating. 3.0 is fairly new and isn't much deployed yet. 2.0 seems to be the most common right now, while 1.x versions are fading out of networks.
Hope some of this was useful or interesting to someone. If I made a mistake, or was confusing anywhere, let me know and I will fix it. A lot of research came from Google searches, considering that some DOCSIS specs are actually kept undisclosed to the public, and are protected under a vendor NDA. However, you can download PDFs of some docsis specs from cablelabs's website (
http://www.cablelabs.com/).