pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/autrin/UDP-socket-programming

ia="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-0b53c3bf3393e2ed.css" /> GitHub - autrin/UDP-socket-programming: A simple UDP Forwarder
Skip to content

autrin/UDP-socket-programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UDP Forwarder

Overview

The UDP Forwarder is a simple program written in C that listens for UDP packets on a specified source IP and port and forwards them to a destination IP and port. It allows for simulating packet loss, making it a useful tool for testing the behavior of applications under unreliable network conditions, such as streaming or real-time data transmission.

Features

Forwards UDP packets from a source to a destination.

Allows specification of packet loss rate to simulate network unreliability.

Displays statistics about forwarded and dropped packets.

Usage

  1. Compile the Program

Use make to compile the program:

make

  1. Run the UDP Forwarder

Run the UDP forwarder with the following command:

<SOURCE_IP>: IP address from which the program will receive UDP packets.

<SOURCE_PORT>: Port on which the program will listen for UDP packets.

<DESTINATION_IP>: IP address to which the program will forward UDP packets.

<DESTINATION_PORT>: Port to which the program will forward UDP packets.

<LOSS_RATE>: The number of packets out of 1000 that will be dropped to simulate packet loss (e.g., 0 for no loss, 10 for 1% loss).

Example ./udp_forwarder 127.0.0.1 5000 127.0.0.1 6000 0

This command will forward all packets from 127.0.0.1:5000 to 127.0.0.1:6000 with no packet loss.

  1. Streaming Video with VLC (Source)

To stream a video file using VLC to the source port, use the following command:

cvlc --repeat test.mp4 --sout '#standard{access=udp,mux=ts,dst=<SOURCE_IP>:<SOURCE_PORT>}'

Example:

cvlc --repeat test.mp4 --sout '#standard{access=udp,mux=ts,dst=127.0.0.1:5000}'

  1. Receiving the Video Stream with VLC (Destination)

On the destination machine, run VLC to receive the forwarded video stream:

vlc -vvv udp://@<DESTINATION_IP>:<DESTINATION_PORT>

Example:

vlc -vvv udp://@127.0.0.1:6000

Requirements

GCC compiler

Linux environment

VLC media player (for testing UDP streaming)

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy