KEMBAR78
WebRTC Report | PDF | Computer Network | Peer To Peer
0% found this document useful (0 votes)
32 views14 pages

WebRTC Report

How to make video calling app using WebRTC API

Uploaded by

Anupam Tiwary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views14 pages

WebRTC Report

How to make video calling app using WebRTC API

Uploaded by

Anupam Tiwary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Peer-to-Peer Video Calling

Using WebRTC
Project 2
PROJCS701

Submitted
In partial fulfilment for the Degree of
Bachelor of Technology
in
Department of Information Technology

Submitted by
Anupam Tiwary
Enrolment no: 12021002018019

Under the Guidance of


Prof. Soumadip Biswas

Institute of Engineering and Management


Kolkata
November 2024
Index

Page

Acknowledgement 2

Abstract 3

1. Problem Definition 4

2. Introduction 4

3. Work done 5

3.1 Review of the works related to the Problem 6

4. Remaining Work to be accomplished 8

5. Conclusion 10

Reference 11
Acknowledgement
I wish to express my heartfelt gratitude to the all the people who
have played a crucial role in the research for this project, without
their active cooperation the preparation of this project could not
have been completed within the specified time limit.

I am thankful to my project guide Prof. Soumadip Biswas who


supported me throughout this project with utmost cooperation and
patience and for helping me in doing this Project.

I am also thankful to our respected Head of the Department, Prof.


Dr. Moutushi Singh, for motivating me to complete this project
with complete focus and attention.

I am thankful to my department and all my teachers for the help


and guidance provided for this work.

I extend my sincere thanks to my institute, the Institute of


Engineering and Management, Kolkata for the opportunity provided
to me for the betterment of my academics.

______________________
Anupam Tiwary
Department of Information Technology
Enrolment No: 12021002018019
Date:
Place: Kolkata
Abstract

This project focuses on the development of a peer-to-peer (P2P)


video calling platform using WebRTC (Web Real-Time
Communication) technology. The application allows two users to
engage in real-time, high-quality video communication directly
through their web browsers, without requiring any third-party
plugins or software installations. The core advantage of using
WebRTC is its ability to establish a direct P2P connection between
users, reducing latency and improving the overall video and audio
quality by eliminating intermediaries. In this project, users can
create and join virtual lobbies by entering a unique lobby ID, where
they can connect with another participant for secure and seamless
video communication.
The implementation of this video calling platform leverages
WebRTC’s strengths, including real-time communication, low-
latency video streaming, and secure data transfer using built-in
encryption methods. While the system currently supports only two
participants per session, it has laid the foundation for further
scalability. The project explores the limitations and opportunities
within WebRTC, including security concerns, network stability, and
the challenge of optimizing quality of service (QoS) under varying
network conditions. Additionally, the architecture of the system
addresses issues related to NAT traversal and the use of Interactive
Connectivity Establishment (ICE) protocols to establish reliable
connections between peers across different network environments.
This report reviews existing literature on video conferencing using
WebRTC, highlighting key strengths such as the ability to provide
high-quality video streams with minimal latency, as well as the
challenges such as security vulnerabilities, browser compatibility
issues, and inconsistencies in video quality due to fluctuating
network conditions. Further research directions are identified,
including the exploration of technologies like mesh networks,
Multipoint Control Units (MCU), and Selective Forwarding Units
(SFU), which are essential for scaling the application to support
multi-user video calls. These technologies will help improve the
system's scalability, ensuring that it can handle more than two
participants while maintaining optimal performance.
Ultimately, this project aims to contribute to the growing body of
knowledge around WebRTC-based communication systems and
provide a solid foundation for future work on multi-user video
conferencing, with a focus on overcoming current limitations related
to security, scalability, and quality of service.
Problem Definition
With the rising demand for real-time communication platforms,
there is a need for solutions that provide secure, low-latency, and
high-quality video calling experiences. While WebRTC has emerged
as a leading technology in this domain, its peer-to-peer architecture
poses limitations, such as challenges in scaling to multiple users
and maintaining consistent quality of service (QoS). Furthermore,
security concerns, interoperability across devices, and optimizing
performance in varying network conditions remain significant
hurdles.
This project seeks to address these issues by developing a two-
person peer-to-peer video calling application using WebRTC. By
analyzing the performance of this system and reviewing existing
solutions, we aim to identify areas for improvement and explore
strategies to expand its functionality to multi-user scenarios.

Introduction
WebRTC (Web Real-Time Communication) has revolutionized how
real-time communication takes place over the web by enabling
direct communication between browsers. It eliminates the need for
intermediaries, resulting in lower latency and higher efficiency.
These characteristics make WebRTC ideal for video calling
applications.

In this project, we have developed a basic video conferencing


website that supports peer-to-peer communication between two
users. Users can create and join lobbies using a unique lobby ID,
ensuring a straightforward and intuitive user experience. The
current implementation highlights WebRTC’s ability to provide high-
quality, real-time video communication while overcoming
challenges like NAT traversal using ICE (Interactive Connectivity
Establishment) protocols.

Although the current system is restricted to two participants per


lobby, it offers significant insights into the strengths and limitations
of WebRTC for video conferencing. This project also lays the
groundwork for scaling to multi-user calls by studying advanced
WebRTC techniques and technologies, such as mesh, MCU, and
SFU.
Work Done
So far in the project, I have successfully developed a basic video
calling platform using WebRTC that supports peer-to-peer (P2P)
communication between two users. The system enables users to
join virtual lobbies and connect with each other using a unique
lobby ID. This ensures that the platform remains simple, scalable,
and efficient for two-person video calls. Below is a detailed
explanation of the steps taken to develop the system and the
technical considerations involved in its implementation.

System Architecture and Design


The project is designed around WebRTC's P2P communication
model, which allows direct media transfer between browsers,
bypassing the need for traditional client-server communication. The
architecture is built using JavaScript for the frontend, where HTML5,
CSS, and Bootstrap were used to design the user interface (UI). For
the backend, I used Node.js with the Express framework to serve
the web pages and handle signaling between the two peers.

The core components of the system include:


1. Signaling Server: A signaling server is essential to establish
the initial connection between peers by exchanging metadata
such as IP addresses, port information, and media capabilities.
I implemented this server using Socket.IO, which provides
real-time, bidirectional communication between the client and
server. The signaling server helps peers discover each other,
initiate the WebRTC connection, and share ICE candidates for
NAT traversal.

2. WebRTC APIs: I utilized the WebRTC APIs, specifically


RTCPeerConnection to establish the media connection
between the two peers and RTCDataChannel for potential
future use in real-time data transfer. RTCPeerConnection is the
main API responsible for managing the peer-to-peer
connection, while RTCDataChannel allows for the exchange of
arbitrary data between peers.

3. Lobby System: I implemented a simple lobby system, where


a user can generate a unique lobby ID and share it with the
other participant to join the call. The system ensures that only
two users can connect in a single lobby, providing a simple
and controlled environment for one-on-one video calls.
4. ICE (Interactive Connectivity Establishment): To establish
a reliable connection between the two peers, I used ICE for
NAT traversal. The ICE protocol helps in discovering the best
possible route between peers by using STUN (Session
Traversal Utilities for NAT) and TURN (Traversal Using
Relays around NAT) servers. I configured a public STUN
server to handle most of the connections but included a
fallback to TURN servers in case direct peer-to-peer
communication was not possible due to strict firewall or NAT
configurations.

3.1 Review of the works related to the problem


After completing the initial work on the project, I conducted an in-
depth review of the existing literature and studies surrounding
WebRTC and its applications in real-time communication,
particularly in video conferencing.
Key Features and Strengths of WebRTC for Video
Conferencing
WebRTC has emerged as a leading technology for real-time
communication, particularly in video conferencing, due to its unique
features:
 Peer-to-Peer Communication: WebRTC’s P2P
communication model eliminates the need for intermediaries
such as servers, allowing for direct communication between
users. This results in reduced latency and improved video
quality by bypassing traditional server-based communication
models.
 Real-Time Communication: WebRTC is designed for real-
time communication, making it ideal for applications requiring
low-latency interaction, such as video calls, messaging, and
file sharing. WebRTC ensures immediate feedback, which is
crucial for creating responsive and interactive communication
systems.
 Scalability: One of the advantages of WebRTC is its ability to
handle large-scale applications. The P2P model makes it easy
to expand WebRTC-based platforms to accommodate more
users. However, there are challenges in scaling WebRTC to
support multi-user conferences, which will be addressed in
future stages of the project.
Challenges and Limitations of WebRTC for Video
Conferencing
Despite its many advantages, WebRTC faces several challenges,
particularly in the context of video conferencing:
 Security Concerns: As WebRTC relies on direct P2P
communication, it is inherently more vulnerable to security
issues like eavesdropping, man-in-the-middle attacks, and
data breaches. Ensuring data privacy and integrity through
encryption, such as Secure Real-Time Transport Protocol
(SRTP) and Datagram Transport Layer Security (DTLS), is
critical.
 Interoperability: WebRTC needs to work across different
browsers and devices, which can be a challenge. Compatibility
issues often arise due to differences in browser
implementations or network conditions. The lack of
standardized signaling protocols also complicates the
interoperability between WebRTC and other communication
systems.
 Quality of Service (QoS): WebRTC’s reliance on P2P
connections means that quality can fluctuate depending on
network conditions. High latency, low bandwidth, or packet
loss can lead to poor video quality, making it essential to
develop methods for managing QoS in varying conditions.
Comparison of WebRTC with Other Video Conferencing
Technologies
WebRTC holds several advantages over traditional video
conferencing technologies, particularly in terms of cost-
effectiveness, lower latency, and higher quality:
 Lower Latency: WebRTC’s P2P communication model offers
lower latency compared to traditional video conferencing
platforms, which often require media relays or centralized
servers.
 Higher Quality: WebRTC’s ability to adjust to changing
network conditions ensures superior video and audio quality,
even in environments with limited bandwidth.
 Cost-Effectiveness: WebRTC’s open-source nature and
scalability make it an ideal choice for developers looking to
build video conferencing platforms without the high costs
associated with proprietary solutions.
Future Research Directions
From the literature review, several areas of future research emerge:
 Improving Security: More robust security measures are
needed to protect WebRTC users from potential threats,
including attacks on encryption protocols and vulnerabilities in
peer-to-peer networks.
 Enhancing Interoperability: Developing standard signaling
protocols and improving compatibility across browsers and
platforms will be crucial for WebRTC’s widespread adoption.
 Optimizing QoS: Researching and developing new
techniques to optimize video quality and minimize latency
across different network conditions will ensure a consistent
and reliable user experience in WebRTC-based video
conferencing applications.
These insights have guided the direction of this project and will
influence the future work on expanding the system to support multi-
user video calls using technologies like mesh, MCU, and SFU.
Remaining Work to Be Accomplished
The current project successfully implements a two-person peer-to-
peer (P2P) video calling application using WebRTC. However, to
expand its functionality and support more users, several areas need
to be addressed. The remaining work focuses on scaling the
application, improving performance, and enhancing security, quality
of service (QoS), and interoperability. Below are the key areas for
further development:
1. Scaling the Application for Multiple Users
Currently, the system supports only two participants per video call.
To scale for larger groups, the following technologies and
architectures need to be explored:
 Mesh Network Architecture:
In a mesh network, each participant connects directly to all
other participants, creating a fully decentralized setup. While
this works for small groups, it doesn’t scale well as the number
of participants increases. The next step is to test this system
with more than two participants and evaluate its impact on
performance, latency, and video quality. This will provide
insights into the limitations of mesh networks and help guide
future scalability strategies.
 Multipoint Control Units (MCU):
MCUs act as central servers that mix audio and video streams
before sending them back to participants. While this approach
reduces the load on clients, it introduces additional server
infrastructure and potential latency. I will explore the
feasibility of implementing an MCU-based architecture and
evaluate whether it can scale effectively while managing the
increased complexity and server load.
 Selective Forwarding Units (SFU):
SFUs forward individual media streams without mixing them,
reducing the server load compared to MCUs. SFUs scale better
for large groups while maintaining high video quality. I will
investigate available SFU solutions and integrate them into the
current system to handle multiple participants efficiently.
2. Improving Quality of Service (QoS)
Maintaining high-quality communication as the number of
participants increases is challenging, especially under varying
network conditions. WebRTC’s mechanisms, such as Adaptive
Bitrate (ABR) and Forward Error Correction (FEC), address QoS
issues but need further optimization:
 Adaptive Bitrate (ABR) Algorithms:
ABR dynamically adjusts the video resolution and bitrate to
match available bandwidth. I will focus on developing more
advanced ABR algorithms to optimize video resolution and
quality based on real-time network conditions, ensuring a
smoother experience even in fluctuating network
environments.
 Forward Error Correction (FEC):
FEC adds redundant data to the media stream to recover lost
packets. I will explore how to enhance FEC techniques to
minimize the impact of packet loss, improving the overall call
reliability and video/audio quality.
3. Addressing Security and Privacy Concerns
WebRTC provides basic encryption protocols such as DTLS and
SRTP to secure data streams, but as the system scales and more
users join, the risk of security breaches increases. The remaining
work will address these concerns:
 Securing Lobby Systems and User Authentication:
Currently, the system relies on a simple lobby ID for joining
calls. I will implement user authentication features, such as
password-based authentication or secure tokens, to ensure
only invited users can access a lobby, improving privacy and
security.
4. Enhancing Interoperability
Ensuring the system works seamlessly across different browsers
and devices is crucial for a broader audience. The next steps
include improving interoperability:
 Cross-Browser Compatibility:
To address inconsistencies across browsers like Chrome,
Firefox, and Safari, I will use libraries like Adapter.js to
normalize WebRTC behavior. Extensive testing will be
conducted to ensure smooth functionality across different
platforms.
 Mobile Device Support:
WebRTC is widely used in mobile applications. I will optimize
the user interface and performance for both iOS and Android
devices, ensuring the video calling platform works effectively
on mobile devices as well as desktops.
5. User Interface (UI) and Experience
While the current system is functional, further improvements are
needed in the user interface and overall user experience (UX) to
make the platform more intuitive and user-friendly:
 Responsive Design:
I will ensure the application’s interface is fully responsive,
optimizing the experience for various screen sizes and
ensuring a consistent video calling experience on both desktop
and mobile devices.

Conclusion
This project demonstrates the potential of WebRTC as a robust
technology for real-time video conferencing. By building a peer-to-
peer video calling platform, we have successfully leveraged
WebRTC’s capabilities for low-latency, high-quality communication.
While the current system is limited to two participants, this project
sets the stage for scaling to multi-user scenarios. Exploring
advanced WebRTC technologies such as mesh, MCU, and SFU will
allow us to design a system that meets the demands of larger
groups while maintaining performance and quality.
As WebRTC continues to evolve, addressing challenges like security,
interoperability, and QoS will be critical. By incorporating these
solutions, this project aims to contribute to the growing field of real-
time communication and provide a reliable, scalable platform for
video conferencing applications.
References
1. Gouaillard A, Roux L (2017) Real-time communication testing
evolution with WebRTC 1.0. In: 2017 Principles, Systems and
Applications of IP Telecommunications (IPTComm), pp 1–8.
IEEE.
2. Loreto S, Romano SP (2017) How far are we from WebRTC-1.0?
An update on standards and a look at what’s next. IEEE
Communications Magazine, 55(7):200–207.
3. Alvestrand H (2021) RFC 8825: Overview: Real-time protocols
for browser-based applications.
4. Kirchner R, Koch S, Kamangar N, Klein D, Johns M (2024) A
black-box privacy analysis of messaging service providers’
chat message processing. Proceedings on Privacy Enhancing
Technologies, 3:1–18.
5. Loreto S, Romano SP (2012) Real-time communications in the
web: Issues, achievements, and ongoing standardization
efforts. IEEE Internet Computing, 16(5):68–73.

You might also like