The next time you're tossing and turning, trying to fall asleep, consider what astronauts face when they're trying to go to bed.

NASA rules dictate that each astronaut aboard the International Space Station should receive a minimum of 8.5 hours of sleep each day. As you might expect, a life in zero gravity doesn't make that particularly easy. Below are the technologies and simple hardware that help astronauts catch a good night's rest while orbiting 249 miles above the Earth.

1. Ventilation is a constant necessity

Unlike on Earth where the natural convection of the air mixes the gases we exhale (oxygen, carbon dioxide and nitrogen), the breathing atmosphere of a space station requires some mechanical disturbance. Without it, exhaled gases would separate and settle based on their relative densities. For astronauts who choose not to sleep near an air ventilator, this would result in an uncomfortable experience as the CO2 they exhale settles around their face. While not deadly (any minor stirring can break up this CO2 bubble) the increase in CO2 would likely wake up the astronaut and/or result in a nasty headache.

According to an engineer who works on the ISS's life support systems, there are areas of the spacecraft that can contain potentially dangerous "dead air."

"There are also indeed dead spaces on ISS where there is not active ventilation such as behind closeout panels or payload racks," the engineer wrote on Reddit. "If the crew would have to access one of these areas they have to sample it to ensure the oxygen concentration is within normal limits prior to sticking their head in that area."

2. Leave your pillow behind

Thanks to zero gravity, the ISS features no mattresses or pillows. Instead, astronauts head off to padded "sleep pods," small rooms that feature a tethered sleeping bag. As astronaut Chris Hadfield explains in the video above, you basically just float asleep, with no need to hold your head or cushion your body. For anyone who has ever just relaxed his or her muscles while snorkeling or scuba diving, it's likely a similar experience — but for 8 hours!

For those who decide to sneak in an untethered nap outside the sleep pod, astronaut Mike Fincke wouldn't recommend it. "We were sitting around the table drinking some tea, and I just fell asleep," he shared in a video. "I started floating away."

2. Earplugs are your friend

Because of the need for constant ventilation, astronauts have compared the sound inside of the ISS to that of a nonstop vacuum cleaner. Thanks to some recordings by Hadfield, you can hear for yourself just how intense all that whirling and venting can be.

Thankfully, the noise within the sleep pods/stations themselves is reduced, falling below 50 decibels. If you like white noise to drift off to, you're in luck. For many astronauts, especially those new to the ISS, earplugs are a constant accessory for both sleep and work.

3. Avoid sleeping near a window

Floating high above the Earth comes with lots of perks, especially for those who enjoy a good sunrise. Astronauts experience no fewer than 15 dawns daily as the ISS soars around the planet at 17,150 miles per hour. While the first several are certainly a treat, these aren't something you want interrupting your sleep. Pull the shade — or better yet, avoid a window altogether when catching some shuteye.

4. Sleeping pills are sometimes necessary

Not surprisingly, astronauts regularly rely upon sleeping pills to help them deal with the noise, motion sickness and other uncomfortable realities of sleeping in zero gravity. A 10-year study on astronaut sleep habits found that 75 percent used sleeping pills, mostly the common brand Ambien.

Of course, this raises its own concerns. As anyone who has ever had to wake up unexpectedly while still under the effects of a sleeping pill can attest to, your mind isn't exactly razor sharp. NASA is aware of the problem and is working on improving its sleep pods to reduce dependency on drugs.

"Our astronauts work in harsh, complex environments where they are sometimes subjected to uncomfortable and high stress situations," the agency said in a statement. "The agency works hard to identify and implement countermeasures that can ensure astronauts are able to get the same quality and quantity of sleep in space as they do on Earth."