104 NS_LOG_INFO ("Create networks and assign IPv6 Addresses."); |
104 NS_LOG_INFO ("Create networks and assign IPv6 Addresses."); |
105 Ipv6AddressHelper ipv6; |
105 Ipv6AddressHelper ipv6; |
106 |
106 |
107 ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64)); |
107 ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64)); |
108 Ipv6InterfaceContainer i1 = ipv6.Assign (d1); |
108 Ipv6InterfaceContainer i1 = ipv6.Assign (d1); |
109 i1.SetRouter (1, true); |
109 i1.SetForwarding (1, true); |
|
110 i1.SetDefaultRouteInAllNodes (1); |
110 |
111 |
111 ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64)); |
112 ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64)); |
112 Ipv6InterfaceContainer i2 = ipv6.Assign (d2); |
113 Ipv6InterfaceContainer i2 = ipv6.Assign (d2); |
113 i2.SetRouter (1, true); |
114 i2.SetForwarding (1, true); |
|
115 i2.SetDefaultRouteInAllNodes (1); |
114 |
116 |
115 ipv6.SetBase (Ipv6Address ("2001:3::"), Ipv6Prefix (64)); |
117 ipv6.SetBase (Ipv6Address ("2001:3::"), Ipv6Prefix (64)); |
116 Ipv6InterfaceContainer i3 = ipv6.Assign (d3); |
118 Ipv6InterfaceContainer i3 = ipv6.Assign (d3); |
117 i3.SetRouter (0, true); |
119 i3.SetForwarding (0, true); |
118 i3.SetRouter (1, true); |
120 i3.SetDefaultRouteInAllNodes (0); |
|
121 i3.SetForwarding (1, true); |
|
122 i3.SetDefaultRouteInAllNodes (1); |
119 |
123 |
120 ipv6.SetBase (Ipv6Address ("2001:4::"), Ipv6Prefix (64)); |
124 ipv6.SetBase (Ipv6Address ("2001:4::"), Ipv6Prefix (64)); |
121 Ipv6InterfaceContainer i4 = ipv6.Assign (d4); |
125 Ipv6InterfaceContainer i4 = ipv6.Assign (d4); |
122 i4.SetRouter (0, true); |
126 i4.SetForwarding (0, true); |
123 i4.SetRouter (1, true); |
127 i4.SetDefaultRouteInAllNodes (0); |
|
128 i4.SetForwarding (1, true); |
|
129 i4.SetDefaultRouteInAllNodes (1); |
124 |
130 |
125 ipv6.SetBase (Ipv6Address ("2001:5::"), Ipv6Prefix (64)); |
131 ipv6.SetBase (Ipv6Address ("2001:5::"), Ipv6Prefix (64)); |
126 Ipv6InterfaceContainer i5 = ipv6.Assign (d5); |
132 Ipv6InterfaceContainer i5 = ipv6.Assign (d5); |
127 i5.SetRouter (0, true); |
133 i5.SetForwarding (0, true); |
128 i5.SetRouter (1, true); |
134 i5.SetDefaultRouteInAllNodes (0); |
|
135 i5.SetForwarding (1, true); |
|
136 i5.SetDefaultRouteInAllNodes (1); |
129 |
137 |
130 ipv6.SetBase (Ipv6Address ("2001:6::"), Ipv6Prefix (64)); |
138 ipv6.SetBase (Ipv6Address ("2001:6::"), Ipv6Prefix (64)); |
131 Ipv6InterfaceContainer i6 = ipv6.Assign (d6); |
139 Ipv6InterfaceContainer i6 = ipv6.Assign (d6); |
132 i6.SetRouter (0, true); |
140 i6.SetForwarding (0, true); |
133 i6.SetRouter (1, true); |
141 i6.SetDefaultRouteInAllNodes (0); |
|
142 i6.SetForwarding (1, true); |
|
143 i6.SetDefaultRouteInAllNodes (1); |
134 |
144 |
135 NS_LOG_INFO ("Create Applications."); |
145 NS_LOG_INFO ("Create Applications."); |
136 |
146 |
137 /** |
147 /** |
138 * ICMPv6 Echo from h0 to h1 port 7 |
148 * ICMPv6 Echo from h0 to h1 port 7 |