Networking for Security, lesson 7 of 12
Bandwidth and video
A card reader sends a few short messages a day. A camera sends a river of data every second, all day and all night. This lesson shows how to measure that river, where many rivers join, and how to be sure the cable that carries them is wide enough.
Fill the uplink
Every camera feeds one switch. One cable, the uplink, carries all of it to the recorder. Change the numbers and watch that cable fill.
The everyday picture
Think of a neighborhood of quiet side streets that all lead to one main road. Each side street carries a few cars and is never busy. The main road carries the cars from every side street at once. If it has too few lanes, traffic backs up, even though every side street looks empty.
A camera network has the same shape. The cable from one camera to the switch is a side street. The cable from the switch toward the recorder is the main road. Problems with video almost never start on the side streets. They start where the traffic joins.
There is one difference from a real road. Cars that cannot fit simply wait. Video that cannot fit is thrown away, and the picture freezes, smears or skips.
Bits, bytes and bitrate
Four words do most of the work in this lesson.
- A bit is the smallest piece of data, a single one or zero. Network speeds are counted in bits per second. A million bits per second is a megabit per second, written Mbps.
- A byte is eight bits. Disk space is counted in bytes: megabytes, gigabytes and terabytes. Mixing up the two is the classic slip. A 100 Mbps cable moves 12.5 megabytes each second, not 100.
- Bitrate is how many bits a camera sends each second. A camera set to 4 Mbps sends four million bits every second it is running.
- Bandwidth is how many bits per second a link can carry. It is the number of lanes on the road.
Network ports come in a few standard speeds. Here are the three you will meet, and where each one turns up on a security job.
| Name | Bandwidth | Where you meet it |
|---|---|---|
| Fast Ethernet | 100 Mbps | The camera ports of many PoE switches, and the port on most cameras |
| Gigabit | 1,000 Mbps | Uplink ports, recorders, servers and most modern switches |
| 10 Gigabit | 10,000 Mbps | The links between main switches on large sites, often on fiber |
What a camera sends
A camera does not send raw pictures. It squeezes them first, which is called compression, and the Video Surveillance course covers how. For network design you only need the result: the bitrate. The figures below are typical ranges for a camera at about 15 pictures per second. Treat them as a starting point and read the real number from the camera's own settings page.
| Picture size | Older compression (H.264) | Newer compression (H.265) |
|---|---|---|
| 2 megapixels (1080p) | 2 to 4 Mbps | 1 to 2 Mbps |
| 4 megapixels | 4 to 6 Mbps | 2 to 3 Mbps |
| 8 megapixels (4K) | 8 to 16 Mbps | 4 to 8 Mbps |
Several things push the number up or down:
- Picture size and frame rate. More pixels, or more pictures per second, means more bits.
- Movement. A camera on an empty corridor sends very little. The same camera on a busy loading dock sends several times more.
- Darkness. At night the picture fills with fine grain, called noise. The camera cannot tell noise from movement, so the bitrate climbs just when you expect it to fall.
- The limit you set. Most cameras let you set a top bitrate. With a constant bitrate the camera always sends that amount. With a variable bitrate it sends less when the scene is quiet and rises toward the limit when it is busy. Design for the limit, not for the quiet moments.
Most cameras can also send two versions of the picture at once. The main stream is the full picture, used for recording. The sub stream is a small, low-bitrate copy, often well under 1 Mbps, used when many cameras share one screen.
Check yourself
Twenty cameras each send 5 Mbps to one switch. How much must the cable from that switch to the recorder carry?
Where traffic adds up
The sum itself is simple. Add the bitrate of every camera whose video crosses a link. That total is the load on the link.
The cable from a switch toward the rest of the network is called its uplink. It is the main road of the everyday picture. Take 24 cameras at 4 Mbps each. Each camera's own cable carries 4 Mbps, a tiny part of its 100 Mbps port. The uplink carries 24 × 4 = 96 Mbps. On a 100 Mbps uplink that is 96 percent, with no room for a busy moment. On a gigabit uplink it is under 10 percent.
How full is too full? A common working rule is to plan for no more than about 70 percent of a link. The spare room absorbs bursts, since a camera sends a large complete picture every second or two and smaller updates in between. It also leaves space for the cameras somebody adds next year.
Walk the whole path, because the uplink is only the first place traffic joins.
| Link | What it carries | The usual trap |
|---|---|---|
| Camera to switch | One camera | Rarely a problem. One camera never fills a 100 Mbps port. |
| Switch uplink | Every camera on that switch | A 100 Mbps uplink on a switch full of cameras |
| Switch to switch, in a chain | Every camera on every switch further down the chain | The last link before the recorder carries the whole site |
| Into the recorder | Every camera it records | A recorder plugged into a slow port, or using one port for recording and viewing together |
| Recorder to viewing stations | Every picture on every screen | A video wall showing main streams when sub streams would do |
| Out to the internet | Whatever is watched remotely | Upload speed, which is often far smaller than download speed |
The same sum tells you about disk space. One megabit per second, kept up for a whole day, fills about 10.8 gigabytes. Here is the working: 1,000,000 bits a second is 125,000 bytes a second, and a day has 86,400 seconds, which makes 10.8 billion bytes. So 96 Mbps of cameras fills roughly 1,037 gigabytes, a little over one terabyte, every day. The Video Surveillance course takes storage further.
Will it fit?
Do each sum in your head or on paper, decide, then press your answer.
Six links to judge
Fits means the traffic is within the link's bandwidth. The explanation tells you whether it also leaves sensible room.
Three examples
Simple: a shop with eight cameras
A corner shop has eight 2-megapixel cameras at 3 Mbps each, on one small PoE switch with a recorder beside it. The total is 8 × 3 = 24 Mbps. The switch has a gigabit uplink port, and the recorder goes there. The link is about 2 percent full. Nothing more needs to be worked out, but the installer writes the sum on the handover sheet so the next person can see the room that remains.
Medium: the warehouse that stutters in the afternoon
A warehouse has 48 cameras on two 24-port PoE switches. The far switch plugs into the near switch, and the near switch plugs into the recorder. Both switches have 100 Mbps uplinks. The cameras are set to a variable bitrate with a 4 Mbps limit.
At night the building is still and each camera sends about 1 Mbps. Everything records well. In the afternoon, forklifts are moving and every camera rises toward its limit. The far switch now pushes 24 × 4 = 96 Mbps into a 100 Mbps link. The near switch needs to pass 48 × 4 = 192 Mbps through its own 100 Mbps uplink, which is impossible. Video is dropped, and the recordings skip at the busiest time of day.
The cause is the uplinks, not the cameras. The fix is switches with gigabit uplinks, each cabled straight back to a main switch beside the recorder instead of through each other.
Advanced: guards watching from another city
A monitoring company wants to watch 16 cameras at a remote yard. The yard's internet service gives 20 Mbps of upload. The main streams run at 6 Mbps, so sending all sixteen would need 96 Mbps. That is nearly five times what the line can carry.
The design uses sub streams. All sixteen are shown as small tiles at 0.5 Mbps each, which is 8 Mbps. When a guard selects one camera to look closely, that single camera switches to its 6 Mbps main stream. The worst case is 8 + 6 = 14 Mbps, which is 70 percent of the upload. The full-quality recording stays on the recorder at the yard and never crosses the internet unless a clip is exported.
From the field
- Read the real bitrate, do not guess it. The camera's settings page and the recorder's status page both show what each camera is sending right now. Look in the daytime and again after dark.
- Check the uplink's speed light. A gigabit port that has linked at 100 Mbps, because of a damaged cable or a poor termination, looks healthy until the cameras get busy. Gigabit needs all four pairs of the cable to be good.
- Set a bitrate limit on every camera. Without a limit, one camera pointed at a tree in the wind can send several times its share.
- Cable switches like a star. Run each camera switch back to one main switch. A chain makes every link carry the traffic of the switches behind it.
- Write the sum on the drawing. "24 cameras × 4 Mbps = 96 Mbps on a 1,000 Mbps uplink" takes ten seconds to write and saves an hour of guessing later.
Common mistakes
- Confusing megabits with megabytes, and so being wrong by a factor of eight.
- Checking the camera's cable, which is always fine, and never checking the uplink.
- Measuring bitrate in a quiet moment and designing for that number.
- Filling a link to 95 percent on paper and calling it enough.
- Assuming the internet line uploads as fast as it downloads.
- Sending main streams to a screen that shows sixteen small tiles.
Summary
- Networks are measured in bits per second and disks in bytes. Eight bits make a byte.
- A camera's bitrate depends on picture size, frame rate, movement, darkness and the limit you set.
- The load on a link is the sum of every camera whose video crosses it.
- Trouble starts where traffic joins: uplinks, chains of switches, the recorder's port and the internet line.
- Plan to use about 70 percent of a link at most, and design for the busiest hour.
Exercises
Answer each one yourself first, then open the answer.
Exercise 1. A link carries 80 Mbps. How many megabytes pass along it each second?
Show answer
Exercise 2. Thirty-two cameras at 6 Mbps share a switch with a gigabit uplink. What is the load, and what share of the uplink is that?
Show answer
Exercise 3. Ten cameras average 2 Mbps over a full day. Roughly how much disk do they fill in that day?
Show answer
Exercise 4 (think, don't memorize). A site records perfectly at night, but the daytime recordings from the cameras on one particular switch have gaps. Nothing has been changed. Where do you look first, and why?