A scenario for rtsp-simple-server and rtsp-simple-proxy: Extended work


In the network topology, I add one dns server node (dnsserver) that is connected to r1. The IP address for dnsserver is I have added server.a.com ( and proxy.a.com ( in the dnsserver. With these settings, the nodes can connect to rtsp server/proxy through domain name.



#!/usr/bin/env python


from mininet.net import Containernet

from mininet.node import Docker

from mininet.cli import CLI

from mininet.link import Link,TCLink

from mininet.log import setLogLevel,info


if '__main__' == __name__:


  net = Containernet(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')

  #dnsserver = net.addHost('dnsserver')

  #You need to change the place where you put the a.com.fwd file

  dnsserver = net.addDocker('dnsserver', dimage="smallko/php-apache-dev:dns-server", volumes=["/home/p4/test_rtsp/test2/a.com.fwd:/etc/bind/a.com.fwd"])


  Link(h1, r1)

  Link(h2, s1)

  Link(h3, s1)

  Link(proxy, s1)

  Link(s1, r1)

  Link(server, r1)

  Link(dnsserver, r1)




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

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

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

  r1.cmd("ifconfig r1-eth3 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")

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

  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")

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

  dnsserver.cmd("ifconfig dnsserver-eth0 netmask")

  dnsserver.cmd("route del default gw")

  dnsserver.cmd("route add default gw")

  dnsserver.cmd("/etc/init.d/bind9 start")






  # 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://server.a.com:8554/mystream

    # whether to receive this stream in udp or tcp

    useTcp: no



$TTL 3600


@ IN SOA ns.a.com. root.a.com. (

           2014062007 ;

           1800       ;

           900        ;

           86400      ;

           3600 )     ;


@ IN NS ns.a.com.

@ IN A


ns.a.com. IN A

www.a.com. IN A

ftp.a.com. IN A

server.a.com. IN A

proxy.a.com. IN A



Before you run the mininet script, you need to download the docker image for dns server.


Run the mininet script


Open terminal for h1,h2,h3, proxy, server


Change the dns server for hosts. (add nameserver in /etc/resolv.conf)


You can ping server or proxy. (Test whether the Domain Name  - IP translation function is ok or not.)


Start rtsp-simple-server


Start rtsp streaming from h1


Start rtsp-simple-proxy


At h2, connect to rtsp-server


At h3, connect to rtsp-proxy



Dr. Chih-Heng Ke

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

Email: smallko@gmail.com