A scenario for rtsp-simple-server and rtsp-simple-proxy


Based on rtsp-simple-server and rtsp-simple-proxy, I wrote this lab. You can download the code and related files from here.



Note: The IP for Proxy in the above figure should be “”, not “”

This scenario is for “when there are multiple users that are receiving a stream and the bandwidth is limited, so the proxy is used to receive the stream once and users connect to the proxy”


[mininet script:test.py]

#!/usr/bin/env python


from mininet.net import Mininet

from mininet.cli import CLI

from mininet.link import Link,TCLink


if '__main__' == __name__:

  net = Mininet(link=TCLink)

  h1 = net.addHost('h1')

  h2 = net.addHost('h2')

  h3 = net.addHost('h3')

  r1 = net.addHost('r1')

  s1 = net.addHost('s1')

  server = net.addHost('server')

  proxy = net.addHost('proxy')


  Link(h1, r1)

  Link(h2, s1)

  Link(h3, s1)

  Link(proxy, s1)

  Link(s1, r1)

  Link(server, r1)




  r1.cmd("ifconfig r1-eth0 0")

  r1.cmd("ifconfig r1-eth1 0")

  r1.cmd("ifconfig r1-eth2 0")

  r1.cmd("echo 1 > /proc/sys/net/ipv4/ip_forward")

  r1.cmd("ip addr add brd + dev r1-eth0")

  r1.cmd("ip addr add brd + dev r1-eth1") 

  r1.cmd("ip addr add brd + dev r1-eth2")

  s1.cmd("ifconfig s1-eth0 0")

  s1.cmd("ifconfig s1-eth1 0")

  s1.cmd("ifconfig s1-eth2 0")

  s1.cmd("ifconfig s1-eth3 0")

  s1.cmd("brctl addbr br0")

  s1.cmd("brctl addif br0 s1-eth0")

  s1.cmd("brctl addif br0 s1-eth1")

  s1.cmd("brctl addif br0 s1-eth2")

  s1.cmd("brctl addif br0 s1-eth3")

  s1.cmd("ifconfig br0 up")

  h1.cmd("ifconfig h1-eth0 0")

  h1.cmd("ip addr add brd + dev h1-eth0")

  h1.cmd("ip route add default via")

  h2.cmd("ifconfig h2-eth0 0")

  h2.cmd("ip addr add brd + dev h2-eth0")

  h2.cmd("ip route add default via")

  h3.cmd("ifconfig h3-eth0 0")

  h3.cmd("ip addr add brd + dev h3-eth0")

  h3.cmd("ip route add default via")

  proxy.cmd("ifconfig proxy-eth0 0")

  proxy.cmd("ip addr add brd + dev proxy-eth0")

  proxy.cmd("ip route add default via")

  server.cmd("ifconfig server-eth0 0")

  server.cmd("ip addr add brd + dev server-eth0")

  server.cmd("ip route add default via")




[configuration file for rtsp-simple-proxy: conf.yml]


  # supported protocols

  protocols: [ tcp, udp ]

  # port of the RTSP TCP listener

  rtspPort: 8554

  # port of the RTP UDP listener

  rtpPort: 8050

  # port of the RTCP UDP listener

  rtcpPort: 8051



  # name of the stream


    # url of the source stream

    url: rtsp://

    # whether to receive this stream in udp or tcp

    useTcp: no



Open an terminal to run the mininet script


Open terminals for h1, h2, h3, proxy, and server


Run the rtsp-simple-server at server


Publish streams to server from h1


Run the rtsp-simple-proxy


Connect to proxy from h2 ( ffplay -i rtsp://


Connect to proxy from h3 ( ffplay -i rtsp://


Dr. Chih-Heng Ke

Department of Computer Science and Information Engineering, National Quemoy University, Kinmen, Taiwan

Email: smallko@gmail.com