CST 311
Programming Assignment 4
1. Network Designs:
2. Full Code with Changes in comments:
3. Program Working
4. h1 ping h2
5. h2 ping h1
6. Questions:
a) What were any interesting things found and lessons learned?
Subnetting and networks are very sensitive to settings changes. This makes networks
incredibly robust and dynamic while offering different levels of security based on how
explicit the settings are vs using automated systems like DHCP.
b) Why didn’t the original program forward packets between the hosts?
The router requires different subnets through each of its interfaces. Without setting the
hosts to different subnets they would not be able to communicate. This could have worked
using a switch instead of a legacy router or if the router had switching integrated. Our
version was basic and did not have the necessary features for it to work out-of-the-box.
b) Is the line ‘ r1.cmd('sysctl -w net.ipv4.ip_forward=1') ’ required?
Yes, that line is required in order to ensure that h1 and h2 can have their pings properly routed. If this
line is removed then h1 and h2 cannot ping each other.
c) Intentionally break your working program, e.g.: change a subnet length, IP
address, or default route for a host. Explain why your change caused the
network to break.
By adjusting subnet length, we start running in to problems with subnet overlap which will
break the network and cause host unreachable errors.