The Fundamental Requirement of Communication
Imagine two people want to talk over the phone.
For communication to happen, each person must know:
- Who they want to call
- How to reach them
Computers work the same way.
For one computer to communicate with another, it needs:
Identity + LocationOn the Internet, this location is represented by an IP address.
What Is an IP Address?
An IP address is the network address of a device.
Think of it like a home address.
Example:
House Address: 777 Chahal street, KKRA courier uses that address to deliver a package.
Similarly:
IP Address: 142.250.193.78allows network packets to reach a device.
Without an address, nobody knows where to send data.
Why Computers Need Addresses
Suppose Alice wants to send data to bob.
Without addresses:
Alice
|
|-----> ????Where should the data go?
The network has no idea.
Addresses solve this problem.
Alice
|
|-----> 142.250.193.78Now the network knows the destination.
IPv4 Addresses
Most addresses are written like:
192.168.1.10Each section:
0 - 255Example:
10.0.0.5
172.16.10.25
8.8.8.8
1.1.1.1The IPv4 Limitation
IPv4 supports approximately:
4.3 billion addressesYears ago this seemed enormous.
Today we have:
- laptops
- phones
- tablets
- smart TVs
- IoT devices
Billions of devices.
Eventually the world began running out of IPv4 addresses.
This led to one of the most important networking inventions: NAT
We will cover this shortly.
Public and Private Networks
Not every IP address is visible on the Internet.
There are two major categories:
Public IP
Visible globally.
Anyone on the Internet can potentially reach it.
Example:
49.37.220.12Private IP
Used inside local networks.
Examples:
192.168.x.x
10.x.x.x
172.16.x.x - 172.31.x.xPrivate addresses cannot be reached directly from the Internet.
The outside Internet cannot directly see them.
What Is a Router?
A router connects different network together.
You home router connects:
Home Network
|
|
Router
|
|
InternetThink of it as a traffic manager.
It decides:
Where packets should goThe Problem Appears
Suppose Laptop:
192.168.1.10tries to access Google
Google receives:
Request from 192.168.1.10Problem:
Millions of homes use:
192.168.1.10Google cannot uniquely identify the device.
This is where NAT enters.
Understanding NAT
NAT means Network Address Translation
One of the most important concepts in WebRTC.
Many WebRTC problems exist solely because NAT exists.
Why NAT Was Invented
The world didn't have enough IPv4 addresses.
Instead of giving every device a public address:
Laptop
Phone
TV
Tabletall devices share a single public address.
Example:
Public IP: 49.37.220.12Home Network Example:
Inside:
Laptop = 192.168.1.10
Phone = 192.168.1.11
TV = 192.168.1.12Outside:
49.37.220.12Everybody appears as:
49.37.220.12to the Internet.
How NAT Works
When your laptop sends:
Hello Googlethe router rewrites the packet.
Before:
Source: 192.168.1.10After:
49.37.220.12Google thinks the request came from:
49.37.220.12not:
192.168.1.10NAT Translation Table
Router maintains a table.
Example:
192.168.1.10 -> Port 50000
192.168.1.11 -> Port 50001
192.168.1.12 -> Port 50002When response return:
49.37.220.12:5000Router knows:
Send to LaptopNAT Solved One Problem
It allowed billions of devices to share a small number of public addresses.
But it create a new problem, which is the Inbound Connection Problem
The Inbound Connection Problem
Imagine:
Alice: 192.168.1.10behind a router.
Bob wants to connect directly.
Bob sends:
Connect to 192.168.1.10Impossible.
Why?
Because:
192.168.1.10exists only inside Alice's network.
The Internet cannot see it.
Why This Matters For WebRTC
Peer-to-Peer communication requires:
Alice <-> BobBut if both are hidden behind NAT:
Alice Router
|
Internet
|
Bob RouterNeither knows how to directly reach the other.
This becomes WebRTC's biggest challenge.
Ports
An IP identifies the machine.
But one machine runs many applications.
Example:
Chrome
Zoom
Spotify
VS code
DiscordIf a packet arrives, who should receive it?
The answer is: Ports
IP addresss and Port together uniquely identify a service.
Socket
Combining:
IP Address + Portcreates: Socket
Example:
49.37.220.12:443A socket is an endpoint for communication.
Transport Protocols
Now we know: IP Address + Port
But how should data travel?
Two major options exist:
TCP
UDPTCP: Transmission Control Protocol
Designed for reliability.
Guarantees:
- delivery
- ordering
- retransmission
Example:
Suppose:
Packet 1
Packet 2
Packet 3sent.
If Packet 2 disappear:
TCP waits.
Packet 1 ✓
Packet 2 ❌
Packet 3 ✓TCP requests retransmission.
Only then continues.
Reliable.
Why TCP Is Great
Perfect for:
- websites
- APIs
- Databases
- file downloads
Because correctness matters more than speed.
Why TCP Is Bad For Real-Time Media
Suppose, Video frame 100 lost.
TCP says:
WaitRetransmit.
During this wait:
Frame 101
Frame 102
Frame 103cannot be delivered properly.
Video freezes.
UDP: User Datagram Protocol
UDP says:
Send packet
Forget packetNo guarantees.
No retransmissions.
No ordering.
Example:
Packet 1 ✓
Packet 2 ❌
Packet 3 ✓UDP continues.
No waiting.
Why UDP Is Perfect For Real-Time Media
Imagine a live conversation.
Would you rather:
Option A:
Miss one wordor
Option B:
Freezes conversation for 3 seconds.Most people choose A.
This is why video calls prefer UDP.
TCP vs UDP
| Feature | TCP | UDP |
|---|---|---|
| Reliable | Yes | No |
| Ordered | Yes | No |
| Retransmission | Yes | No |
| Latency | Higher | Lower |
| Video Calls | Poor Choice | Excellent Choice |
| File Download | Excellent | Poor Choice |
Firewalls
One more obstacle.
Organizations often deploy:
Firewallsto control traffic.
Firewall rules may:
Allow
Block
Inspectnetwork packets.
Many WebRTC failures happen because:
Firewall Blocks TrafficLeave a comment
Your email address will not be published. Required fields are marked *
