Skip to content

012802HJoshi/Project-Dgram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛰️ Project-Dgram

Node.js License Status Contributions Made With Love


📘 Overview

Project-Dgram is a simple and educational Node.js project that demonstrates how to work with the User Datagram Protocol (UDP).
UDP divides data into small packets called datagrams and sends them directly to the destination — without establishing a connection — making it fast, lightweight, and perfect for real-time communication.


⚙️ Features

  • Send and receive UDP datagrams using Node.js
  • Understand connectionless communication
  • Lightweight and easy to modify for experiments
  • Great for learning or network debugging

🌐 What is UDP?

UDP (User Datagram Protocol) is one of the main transport-layer protocols in the Internet Protocol (IP) suite.
It sends independent packets of data called datagrams with minimal overhead.

Unlike TCP:

  • It does not guarantee delivery
  • It does not check for errors
  • It does not ensure order

This makes it faster and more efficient for time-critical data transmission.


🌟 Advantages of UDP

Advantage Description
Speed No connection setup — faster data delivery
🧠 Low Overhead Smaller headers and less processing per packet
📡 Broadcast & Multicast Support Ideal for one-to-many communication
🔗 Connectionless No handshaking, lower latency
💬 Perfect for Real-Time Apps Used in games, VoIP, live streaming, and IoT
🔁 Small Data Transfers Efficient for short or repetitive messages

💻 Example (Node.js)

server.js

const dgram = require('dgram');
const server = dgram.createSocket('udp4');

server.on('message', (msg, rinfo) => {
  console.log(`Received: ${msg} from ${rinfo.address}:${rinfo.port}`);
});

server.bind(41234, () => {
  console.log('UDP Server is listening on port 41234');
});

About

User Datagram Protocol (UDP) using NodeJs Dgram

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published