# vRouter sample network descriptor file


# First, declare datalinks
# datalink <network address> <bandwidth in bps> <delay in ms>

datalink 10.0.0.4/30  10000000 0
datalink 10.0.0.8/30  10000000 0
datalink 10.0.0.12/30 10000000 0
datalink 10.1.1.0/24  10000000 0
datalink 10.1.2.0/24  10000000 0
datalink 10.1.3.0/24  10000000 0
datalink 10.0.0.0/30  10000000 0
datalink 10.0.0.16/30 10000000 0
datalink 10.0.0.20/30 10000000 0
datalink 10.0.0.24/30 10000000 0


# now declare routers


# boston is the "east coast" hub router in this example, with connections
# to charleston, new york, and pittsburgh.
# west-bound traffic gets relayed through boston

router boston
	interface 10.0.0.0/30 10.0.0.2/30
	interface 10.0.0.16/30 10.0.0.17/30
	interface 10.0.0.20/30 10.0.0.21/30
	interface 10.0.0.24/30 10.0.0.25/30

	route 10.0.2.0/24 10.0.0.18/30 0
	route 10.0.3.0/24 10.0.0.22/30 0
	route 10.0.4.0/24 10.0.0.26/30 0

	route 0.0.0.0/0 10.0.0.1/30 0 # default route to san_francisco
end-router

# an east coast router, serviced through boston
router new_york
	interface 10.0.0.16/30 10.0.0.18/30 # to boston

	route 0.0.0.0/0 10.0.0.17/30 0 # default route to boston
end-router

# an east coast router, serviced through boston
router charleston
	interface 10.0.0.20/30 10.0.0.22/30 # to boston

	route 0.0.0.0/0 10.0.0.21/30 0 # default route to boston
end-router

# an east coast router, serviced through boston
router pittsburgh
	interface 10.0.0.24/30 10.0.0.26/30 # to boston

	route 0.0.0.0/0 10.0.0.25/30 0 # default route to boston
end-router

# a west coast router, serviced through san_francisco
router seattle
	interface 10.0.0.4/30 10.0.0.6/30 # to san_francisco
	interface 10.1.1.0/24 10.1.1.254/24 # a local ethernet

	route 0.0.0.0/0 10.0.0.5/30 0 # default route to san_francisco
end-router

# the west coast hub router, analagous to boston on east coast
router san_francisco
	interface 10.0.0.4/30 10.0.0.5/30
	interface 10.0.0.8/30 10.0.0.9/30
	interface 10.0.0.12/30 10.0.0.13/30
	interface 10.0.0.0/30 10.0.0.1/30

	route 10.1.1.0/24 10.0.0.6/30 0 
	route 10.1.2.0/24 10.0.0.14/30 0
	route 10.0.3.0/24 10.0.0.10/30 0

	route 0.0.0.0/0 10.0.0.2/30 0 #default route to boston
end-router

# another west coast router, serviced through san_francisco
router san_jose
	interface 10.0.0.12/30 10.0.0.14/30
	interface 10.1.2.0/24 10.1.2.254/24 # a local ethernet

	route 0.0.0.0/0 10.0.0.13/30 0
end-router

# another west coast router, serviced through san_francisco
router los_angeles
	interface 10.0.0.8/30 10.0.0.10/30
	interface 10.1.3.0/24 10.1.3.254/24 # a local ethernet

	route 0.0.0.0/0 10.0.0.9/30 0
end-router
end-network

# for our simulation, we have two flows from east coast
# routers to seattle
# there is sufficient bandwidth on their links to boston
# to handle the traffic, but boston doesn't have enough to 
# relay all the packets to san_francisco, so packets get delayed/dropped
# at boston

simulation
# flow src-router src-address(ignored) dst-address size rate starttime duration
flow charleston 10.0.0.6/30 10.0.0.6/30 1000 1000 0 100
flow pittsburgh 10.0.0.6/30 10.0.0.6/30 1000 1000 0 100
#run timeslice-width(ms) number-of-timeslices
run 5 40
end-simulation
end








