diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2aa7d37 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs/template"] + path = docs/template + url = ../typst-template diff --git a/docs/main.pdf b/docs/main.pdf new file mode 100644 index 0000000..2082fa6 Binary files /dev/null and b/docs/main.pdf differ diff --git a/docs/main.typ b/docs/main.typ new file mode 100644 index 0000000..4b253bb --- /dev/null +++ b/docs/main.typ @@ -0,0 +1,69 @@ +#import "template/module.typ": * + +#show: default.with( + title: "SDN - Lab 1", + authors: (( + name: "Yi-Ting Shih (111550013)", + affiliation: "National Yang Ming Chaio Tung University", + email: "ytshih@cs.nycu.edu.tw", + ),), +) + += Part 1: Answer Questions + +1. When ONOS activate "org.onosproject.openflow," what APPs does it activate? + +It activates: +- org.onosproject.openflow +- org.onosproject.hostprovider +- org.onosproject.lldpprovider +- org.onosproject.openflow-base +- org.onosproject.optical-model + +2. After we activate ONOS and run P.17 Mininet command, will H1 ping H2 successfully? Why or why not? + +No, S1 and S2 will not forward packets unless `org.onosproject.fwd` is activated. + +3. Which TCP port does the controller listen to the OpenFlow connection request from the switch? (Take screenshot and explain your answer.) + +> netstat before activating `org.onosproject.openflow-base` +#image("part1-1.png", width: 350pt) + +> netstat after activating `org.onosproject.openflow-base` +#image("part1-2.png", width: 350pt) + +The ports that appeared only when openflow-base were enabled are: +- tcpv6 `:::6633` +- tcpv6 `:::6653` + +4. In question 3, which APP enables the controller to listen on the TCP port? + +`org.onosproject.openflow-base` + += Part 2: Create a custom Topology + +> Run your Python script and use command "pingall" +#image("part2-1.png", width: 350pt) + +> Then take a screenshot of topology on GUI +#image("part2-2.png", width: 350pt) + += Part 3: Statically assign Hosts IP Address in Mininet + +> command "dump" +#image("part3-1.png", width: 350pt) + +> "ifconfig" on host h1 +#image("part3-2.png", width: 350pt) + +> "ifconfig" on host h2 +#image("part3-3.png", width: 350pt) + +> "ifconfig" on host h3 +#image("part3-4.png", width: 350pt) + +> "ifconfig" on host h4 +#image("part3-5.png", width: 350pt) + +> "ifconfig" on host h5 +#image("part3-6.png", width: 350pt) diff --git a/docs/part1-1.png b/docs/part1-1.png new file mode 100644 index 0000000..cc34be3 Binary files /dev/null and b/docs/part1-1.png differ diff --git a/docs/part1-2.png b/docs/part1-2.png new file mode 100644 index 0000000..80dfc46 Binary files /dev/null and b/docs/part1-2.png differ diff --git a/docs/part2-1.png b/docs/part2-1.png new file mode 100644 index 0000000..ae2852f Binary files /dev/null and b/docs/part2-1.png differ diff --git a/docs/part2-2.png b/docs/part2-2.png new file mode 100644 index 0000000..89fa3bd Binary files /dev/null and b/docs/part2-2.png differ diff --git a/docs/part3-1.png b/docs/part3-1.png new file mode 100644 index 0000000..0f94509 Binary files /dev/null and b/docs/part3-1.png differ diff --git a/docs/part3-2.png b/docs/part3-2.png new file mode 100644 index 0000000..8e223a9 Binary files /dev/null and b/docs/part3-2.png differ diff --git a/docs/part3-3.png b/docs/part3-3.png new file mode 100644 index 0000000..a0c8701 Binary files /dev/null and b/docs/part3-3.png differ diff --git a/docs/part3-4.png b/docs/part3-4.png new file mode 100644 index 0000000..92f4ad0 Binary files /dev/null and b/docs/part3-4.png differ diff --git a/docs/part3-5.png b/docs/part3-5.png new file mode 100644 index 0000000..1293085 Binary files /dev/null and b/docs/part3-5.png differ diff --git a/docs/part3-6.png b/docs/part3-6.png new file mode 100644 index 0000000..68fda51 Binary files /dev/null and b/docs/part3-6.png differ diff --git a/docs/template b/docs/template new file mode 160000 index 0000000..5a29091 --- /dev/null +++ b/docs/template @@ -0,0 +1 @@ +Subproject commit 5a290913a2b076125191ce8c1c46457e726b893d diff --git a/lab1_111550013/lab1_111550013.pdf b/lab1_111550013/lab1_111550013.pdf new file mode 100644 index 0000000..2082fa6 Binary files /dev/null and b/lab1_111550013/lab1_111550013.pdf differ diff --git a/lab1_111550013/lab1_111550013.zip b/lab1_111550013/lab1_111550013.zip new file mode 100644 index 0000000..e0f135b Binary files /dev/null and b/lab1_111550013/lab1_111550013.zip differ diff --git a/lab1_111550013/lab1_part2_111550013.py b/lab1_111550013/lab1_part2_111550013.py new file mode 100644 index 0000000..5ed1209 --- /dev/null +++ b/lab1_111550013/lab1_part2_111550013.py @@ -0,0 +1,28 @@ +from mininet.topo import Topo + +class Lab1_Topo_111550013(Topo): + def __init__(self): + Topo.__init__(self) + + h1 = self.addHost('h1') + h2 = self.addHost('h2') + h3 = self.addHost('h3') + h4 = self.addHost('h4') + h5 = self.addHost('h5') + + s1 = self.addSwitch('s1') + s2 = self.addSwitch('s2') + s3 = self.addSwitch('s3') + s4 = self.addSwitch('s4') + + self.addLink(h1, s1) + self.addLink(h2, s2) + self.addLink(h3, s3) + self.addLink(h4, s4) + self.addLink(h5, s4) + + self.addLink(s1, s2) + self.addLink(s2, s3) + self.addLink(s2, s4) + +topos = {'topo_part2_111550013': Lab1_Topo_111550013} diff --git a/lab1_111550013/lab1_part3_111550013.py b/lab1_111550013/lab1_part3_111550013.py new file mode 100644 index 0000000..026d5fa --- /dev/null +++ b/lab1_111550013/lab1_part3_111550013.py @@ -0,0 +1,28 @@ +from mininet.topo import Topo + +class Lab1_Topo_111550013(Topo): + def __init__(self): + Topo.__init__(self) + + h1 = self.addHost('h1', ip='192.168.0.1/27') + h2 = self.addHost('h2', ip='192.168.0.2/27') + h3 = self.addHost('h3', ip='192.168.0.3/27') + h4 = self.addHost('h4', ip='192.168.0.4/27') + h5 = self.addHost('h5', ip='192.168.0.5/27') + + s1 = self.addSwitch('s1') + s2 = self.addSwitch('s2') + s3 = self.addSwitch('s3') + s4 = self.addSwitch('s4') + + self.addLink(h1, s1) + self.addLink(h2, s2) + self.addLink(h3, s3) + self.addLink(h4, s4) + self.addLink(h5, s4) + + self.addLink(s1, s2) + self.addLink(s2, s3) + self.addLink(s2, s4) + +topos = {'topo_part3_111550013': Lab1_Topo_111550013}