Sunday, June 11, 2017

A Primer on IP Addresses

Just like your have a home address that uniquely identifies your residence out of all the residences in the world, computers have IP addresses, which serve the same purpose.  They uniquely identify a computer in a network so that it can receive messages from other computers.


IPv4 was created when the internet was born in 1981 and is still used today.  It is the network communication protocol that computers use to talk to each other over the internet.  An IPv4 address is a unique identifier that is used to identify an individual computer that is connected to the internet.  It is 32-bits long and is commonly represented in dotted-decimal notation.  This notation divides the bits into four, 8-bit chunks and displays each chunk as a number ranging from 0 to 255.  Each number is separated with a dot.  For example:

At its inception, the set of all possible IPv4 addresses, called the address space, was divided into “classes”.  Each class contained a finite number of “chunks” of addresses.  The number of addresses in each chunk varied depending on the class.  The idea was that institutions, such as companies and schools, could purchase one of these chunks, and then dole out the addresses in the chunk to all the computers on their network.  Larger institutions with lots of computers could purchase a more expensive, higher class chunk that had lots of addresses, while smaller institutions that had fewer computers could purchase a cheaper, lower class chunk that had fewer sub addresses.

The classes are summarized below.  If you want to learn more about the logic behind how they were organized, I suggest you read this Wikipedia page.

Number of chunks
Number of addresses in each chunk
Class A
Class B
Class C
Class D
Class E

Do you see a problem here?

The problem with this scheme was that companies were unlikely to use every address that was available to them.  The choices for the number of addresses you could have varied wildly—you could have 16,777,216, 65,536, or 256!  You couldn't have anything in between!  If a company needed, say, 1,000 addresses, they had no choice but to purchase a Class B address and put all the rest to waste.  To top it off, some of the organizations that were involved in the early development of the internet possessed Class A chunks, which they were hardly making any use of.

This started to become a pressing issue as the internet grew.  The risk that all IP addresses would be used up, called IP address exhaustion, became a real possibility.


As shown, the way the class system divided up its chunks of addresses was very coarse-grained, which resulted in lots of wasted addresses.  To combat this, the class system was done away with in 1993 and replaced with a system called CIDR (Classless Inter-Domain Routing).  This system gives organizations many more choices regarding how many addresses they are assigned, which results in less wasted addresses.

CIDR uses something called variable-length subnet masking (VLSM), which allows the address's subnet mask (the part that identifies which organization an address belongs to) to be of any size.  The class system, on the other hand, only permitted the subnet mask to be 8 bits (Class A), 16 bits (Class B), or 24 bits (Class C) long.  With CIDR, if your company only needed 1,000 addresses, you could purchase a 1,024 chunk (22-bit subnet mask, leaving 10-bits for the address, 2^10=1,024).

CIDR notation consists of an IP address, followed by the number of bits the address uses for its subnet mask.  For example, represents the IP address with the first 22 bits of that address being the subnet mask.

But CIDR is only a stop-gap measure.  The IPv4 address space consists of about 4.3 billion addresses, which seems like a lot.  But on a global scale, it is not.  If the internet continues to grow, the IPv4 address space will soon run out.  A more permanent solution would be to increase the length of the IP address.  Enter IPv6.


Created in 1998, IPv6 addresses are a whopping 128 bits long, resulting in an incredibly large address space of 3.4 x 10^38 (the number of grains of sand on Earth...or something?).

IPv6 addresses are represented as eight, four character, hexadecimal strings separated by colons.


Because they are so long, there are tricks you can employ to make them shorter.  If a segment contains all zeroes, you can replace the segment with a single zero:


If an address contains consecutive segments which consist of all zeroes, you can replace them with a double colon (but you can only use this trick once):


And if a segment begins with zeroes, you can leave the zeroes out (unless the segment contains all zeroes, in which case you must leave one zero in):


IPv6 and IPv4 are not compatible with each other, which complicates the migration process.  While it is likely that the network card in your computer supports both IPv4 and IPv6, the infrastructure around the globe that makes the internet work cannot switch over so easily.  It will be a long and piecemeal process.  But if all goes well, you won't even know it happened.

Tuesday, June 6, 2017

The Laser Printing Process

There are many different kinds of printers on the market. In office environments, laser printers are by far the most numerous. Not only do they produce good quality printouts, but they are fast, which is important when you have people to please and deadlines to meet. Therefore, computer technicians have to be very familiar with how laser printers work so breakdowns can be fixed and Janet can get her TPS reports on time.

A laser printer follows a specific process when printing a sheet of paper. The process can be divided into seven steps.

1. Processing

In order to start printing, the printer has to first receive print data from a computer. The program the user is printing from (say, a word processor) has to first convert the document to some kind of format the printer understands. Many Windows applications use a system called GDI (graphical device interface), which is used in conjunction with the specific printer driver, to generate this print data.

The application then sends the print data to the print spooler, which is responsible for queuing up print jobs and sending them one at a time to the printer. Once the print job has been completely sent to the printer, it disappears from the print spooler (whether the printer is done printing it or not).

Note that, while it is possible to cancel a print job from the print spooler, this only stops the flow of information from the computer to the printer. For example, if the spooler sends half of the print job before you cancel it, the printer will print exactly that, even if the job is canceled before any pages came out of the printer. Therefore, you should also press the “stop” button on the printer itself to be sure the printing truly stops (do not pull out the paper tray, as this could jam the printer).

2. Charging

The rest of this process is centered around an important part of the printer called the drum. The drum is a cylinder shaped component which is used to transfer images onto the sheets of paper.  It does this using positive and negative electrical charges.

In the Charging step, the primary corona wire (or primary charge roller) gives the drum's surface a uniform negative electrical charge.

3. Exposing

A laser draws a positively charged image into the drum (hence the name, “laser printer”).

4. Developing

Negatively-charged toner particles attach themselves to the positively-charged parts of the drum the laser drew from the last step. "Toner" is the stuff that makes up the image on the piece of paper (it is a laser printer's “ink”).

5. Transferring

Here is where the actual piece of paper comes into play. The transfer corona (or transfer roller) applies a positive charge to a sheet of paper. Then, the negatively-charged toner particles on the drum attach themselves to the positively-charged paper. Voila! The toner has been “transferred” to the page.

6. Fusing

At this point, the toner is simply resting on top of the page like a layer of dust. In the Fusing step, the toner is melted onto the page using a heating element called the fuser (toner is mostly made of plastic). Hot Pockets! The page is now done!

7. Cleaning

Now that the page is done, the printer has to be “reset” for the next page. Notably, the drum must be cleaned. First, any residual toner is scraped off using a rubber cleaning blade. Then, erase lamps give the drum a neutral charge. Go back to step 2.