🌏 YMMP: Yumetter Messaging Protocol
Prerequisites
Summary
YMMP is a protocol for broadcast a notification to all nodes within the network or subnet, made for Yumetter project.
The lower layer protocol is UDP (User Diagram Protocol), and uses port 17339 by default.
Usage
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
fn main() {
let addr = SocketAddrV4::new(Ipv4Addr::LOCALHOST, 17339);
let target = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::BROADCAST, 17339));
let broadcaster = ymmp::Broadcaster::bind(addr, target);
let message = vec![b'h', b'e', b'l', b'l', b'o'];
let packet = ymmp::Packet::new(message);
broadcaster
.broadcast(packet)
.expect("Failed to broadcast.")
;
}
Diagram
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
0 |
Magic Bytes (YMMP ) |
Version (v0.1 ) |
8 |
Length of Message (Little Endian) |
16 |
Raw Message (0..N octets) |
32 |